diff --git a/src/web/Api_v1.cpp b/src/web/Api_v1.cpp index b24555339..090565937 100644 --- a/src/web/Api_v1.cpp +++ b/src/web/Api_v1.cpp @@ -201,16 +201,19 @@ Api_v1::sid( QxtWebRequestEvent* event, QString unused ) void Api_v1::processSid( QxtWebRequestEvent* event, Tomahawk::result_ptr& rp, QSharedPointer< QIODevice >& iodev ) { - if ( !iodev || iodev.isNull() ) + tDebug( LOGVERBOSE ) << Q_FUNC_INFO; + if ( !iodev || !rp ) { return send404( event ); // 503? } + m_ioDevice = iodev; QxtWebPageEvent* e = new QxtWebPageEvent( event->sessionID, event->requestID, iodev.data() ); e->streaming = iodev->isSequential(); e->contentType = rp->mimetype().toLatin1(); if ( rp->size() > 0 ) e->headers.insert( "Content-Length", QString::number( rp->size() ) ); + postEvent( e ); } diff --git a/src/web/Api_v1.h b/src/web/Api_v1.h index 06cb411dc..a8f4a6c8a 100644 --- a/src/web/Api_v1.h +++ b/src/web/Api_v1.h @@ -78,7 +78,9 @@ public slots: private: void processSid( QxtWebRequestEvent* event, Tomahawk::result_ptr&, QSharedPointer< QIODevice >& ); + QxtWebRequestEvent* m_storedEvent; + QSharedPointer< QIODevice > m_ioDevice; }; #endif