From dd35019c4542c90387d63d297d67053afe638d6a Mon Sep 17 00:00:00 2001 From: Sude Date: Sat, 16 Mar 2013 20:48:35 +0200 Subject: [PATCH] Increase connection timeout to 10 seconds. Don't convert POST requests into GET requests when following redirects (respect RFC 2616/10.3.2) --- src/downloader.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/downloader.cpp b/src/downloader.cpp index c323157..13296a6 100644 --- a/src/downloader.cpp +++ b/src/downloader.cpp @@ -52,7 +52,7 @@ int Downloader::init() curl_easy_setopt(curlhandle, CURLOPT_FOLLOWLOCATION, 1); curl_easy_setopt(curlhandle, CURLOPT_USERAGENT, config.sVersionString.c_str()); curl_easy_setopt(curlhandle, CURLOPT_NOPROGRESS, 0); - curl_easy_setopt(curlhandle, CURLOPT_CONNECTTIMEOUT, 5); + curl_easy_setopt(curlhandle, CURLOPT_CONNECTTIMEOUT, 10); curl_easy_setopt(curlhandle, CURLOPT_PROGRESSDATA, this); curl_easy_setopt(curlhandle, CURLOPT_FAILONERROR, true); curl_easy_setopt(curlhandle, CURLOPT_COOKIEFILE, config.sCookiePath.c_str()); @@ -955,6 +955,7 @@ int Downloader::HTTP_Login(const std::string& email, const std::string& password curl_easy_setopt(curlhandle, CURLOPT_POSTFIELDS, postdata.c_str()); curl_easy_setopt(curlhandle, CURLOPT_WRITEDATA, &memory); curl_easy_setopt(curlhandle, CURLOPT_NOPROGRESS, 1); + curl_easy_setopt(curlhandle, CURLOPT_POSTREDIR, CURL_REDIR_POST_ALL); curl_easy_perform(curlhandle); memory.str(std::string()); curl_easy_setopt(curlhandle, CURLOPT_HTTPGET, 1);