From 29dc0fede0c7a5086c869863f3e412b7e8883f6e Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Tue, 11 Dec 2007 20:23:13 +0000 Subject: [PATCH] - DownloadThread can now follow redirections (fixes Mininova search engine) --- TODO | 4 +++- src/downloadThread.cpp | 8 ++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/TODO b/TODO index 83d170111..772442e6e 100644 --- a/TODO +++ b/TODO @@ -53,5 +53,7 @@ TODO: - Check search engine cpu usage -rc10->? changelog: +rc10->rc11? changelog: - BUGFIX: Bypass exit confirmation on system shutdown +- BUGFIX: Download from urls are now able to follow redirections +- BUGFIX: Clean up for failed torrents downloaded from urls diff --git a/src/downloadThread.cpp b/src/downloadThread.cpp index 738bfcc83..09dbc3c71 100644 --- a/src/downloadThread.cpp +++ b/src/downloadThread.cpp @@ -112,6 +112,14 @@ void subDownloadThread::run(){ // We have to define CURLOPT_WRITEFUNCTION or it will crash on windows curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, fwrite); curl_easy_setopt(curl, CURLOPT_WRITEDATA, f); + // Verbose + curl_easy_setopt(curl, CURLOPT_VERBOSE, 1); + // No progress info (we don't use it) + curl_easy_setopt(curl, CURLOPT_NOPROGRESS, 1); + // Redirections + curl_easy_setopt(curl, CURLOPT_AUTOREFERER, 1); + curl_easy_setopt(curl, CURLOPT_FOLLOWLOCATION, 1); + curl_easy_setopt(curl, CURLOPT_MAXREDIRS, -1); qDebug("Downloading %s", url.toUtf8().data()); res = curl_easy_perform(curl); /* always cleanup */