diff --git a/article_netmgr.cc b/article_netmgr.cc index e6f95074..76471b61 100644 --- a/article_netmgr.cc +++ b/article_netmgr.cc @@ -185,7 +185,9 @@ using std::string; void AllowFrameReply::readDataFromBase() { - QByteArray data = baseReply->readAll(); + QByteArray data; + data.resize( baseReply->bytesAvailable() ); + baseReply->read( data.data(), data.size() ); buffer += data; emit readyRead(); } diff --git a/webmultimediadownload.cc b/webmultimediadownload.cc index 125fa363..715cc5c5 100644 --- a/webmultimediadownload.cc +++ b/webmultimediadownload.cc @@ -61,13 +61,11 @@ void WebMultimediaDownload::replyFinished( QNetworkReply * r ) // Handle reply data - QByteArray all = r->readAll(); - Mutex::Lock _( dataMutex ); - data.resize( all.size() ); + data.resize( r->bytesAvailable() ); - memcpy( data.data(), all.data(), all.size() ); + r->read( data.data(), data.size() ); hasAnyData = true; }