From d52c505daaef53cd1c039c1d2b993b7d389c9d94 Mon Sep 17 00:00:00 2001 From: Alex Borisov Date: Sun, 18 Mar 2012 09:51:39 +0200 Subject: FIX: infinite uploading issue, download speed issue --- client/DownloadClient.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'client/DownloadClient.cpp') diff --git a/client/DownloadClient.cpp b/client/DownloadClient.cpp index 723dbcb..110601a 100644 --- a/client/DownloadClient.cpp +++ b/client/DownloadClient.cpp @@ -57,7 +57,11 @@ void DownloadClient::DoDownload() QString filename = QString::fromLocal8Bit(file.first.c_str()); string md5 = file.second; current = new QFile(filename); - current->open(QIODevice::WriteOnly | QIODevice::Unbuffered); + if (! current->open(QIODevice::WriteOnly | QIODevice::Unbuffered)) + { + Logger::Info("Can't open file: path isn't available\n"); + DoDownload(); + } Logger::Info("Downloading file (%d of %u): %s\n", currentId + 1, files.size(), file.first.c_str()); SendFileRequest(file.first); -- cgit v1.2.3