From e22aeca3ff979238f701683429869f7556116407 Mon Sep 17 00:00:00 2001 From: Tannin Date: Tue, 17 Jun 2014 18:36:28 +0200 Subject: - download read buffer is now limited to 1MB. Might prevent out-of-memory errors during download - bugfix: plugins are now disabled when deactivating a mod before the files are removed from the vfs --- src/downloadmanager.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'src/downloadmanager.cpp') diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index e3cab528..d6456fc7 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -350,9 +350,6 @@ bool DownloadManager::addDownload(QNetworkReply *reply, const ModRepositoryFileI bool DownloadManager::addDownload(QNetworkReply *reply, const QStringList &URLs, const QString &fileName, int modID, int fileID, const ModRepositoryFileInfo *fileInfo) { - if (!reply->isRunning()) { - qDebug("this is not a running download! %d", reply->isFinished()); - } // download invoked from an already open network reply (i.e. download link in the browser) DownloadInfo *newDownload = DownloadInfo::createNew(fileInfo, URLs); @@ -401,6 +398,7 @@ void DownloadManager::removePending(int modID, int fileID) void DownloadManager::startDownload(QNetworkReply *reply, DownloadInfo *newDownload, bool resume) { + reply->setReadBufferSize(1024 * 1024); // don't read more than 1MB at once to avoid memory troubles newDownload->m_Reply = reply; setState(newDownload, STATE_DOWNLOADING); if (newDownload->m_Urls.count() == 0) { -- cgit v1.3.1