From ecf02c1b473d61e65c5afaba8cde3774b38e112f Mon Sep 17 00:00:00 2001 From: Michael Andres Date: Tue, 13 May 2014 13:10:44 +0200 Subject: [PATCH] Adjust transfer timeout settings (bnc#877405) --- zypp/media/MediaCurl.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/zypp/media/MediaCurl.cc b/zypp/media/MediaCurl.cc index 35565e3..8831dc3 100644 --- a/zypp/media/MediaCurl.cc +++ b/zypp/media/MediaCurl.cc @@ -598,6 +598,13 @@ void MediaCurl::setupEasy() * Connect timeout */ SET_OPTION(CURLOPT_CONNECTTIMEOUT, _settings.connectTimeout()); + // If a transfer timeout is set, also set CURLOPT_TIMEOUT to an upper limit + // just in case curl does not trigger its progress callback frequently + // enough. + if ( _settings.timeout() ) + { + SET_OPTION(CURLOPT_TIMEOUT, 3600L); + } // follow any Location: header that the server sends as part of // an HTTP header (#113275) @@ -715,7 +722,7 @@ void MediaCurl::setupEasy() { SET_OPTION(CURLOPT_LOW_SPEED_LIMIT, _settings.minDownloadSpeed()); // default to 10 seconds at low speed - SET_OPTION(CURLOPT_LOW_SPEED_TIME, 10L); + SET_OPTION(CURLOPT_LOW_SPEED_TIME, 60L); } #if CURLVERSION_AT_LEAST(7,15,5) -- 2.7.4