Skip to content
This repository
Browse code

fixed: Curl should also retry on CURLE_COULDNT_CONNECT

fixed: Curl reconnect messages should be warnings
changed: Cosmetics
  • Loading branch information...
commit d70bd1064c1314913bc69a260c4cbd423b1fb841 1 parent 1e7c4ae
authored

Showing 1 changed file with 6 additions and 5 deletions. Show diff stats Hide diff stats

  1. 11  xbmc/filesystem/CurlFile.cpp
11  xbmc/filesystem/CurlFile.cpp
@@ -1201,7 +1201,7 @@ unsigned int CCurlFile::CReadState::Read(void* lpBuf, int64_t uiBufSize)
1201 1201
 /* use to attempt to fill the read buffer up to requested number of bytes */
1202 1202
 bool CCurlFile::CReadState::FillBuffer(unsigned int want)
1203 1203
 {
1204  
-  int retry=0;
  1204
+  int retry = 0;
1205 1205
   fd_set fdread;
1206 1206
   fd_set fdwrite;
1207 1207
   fd_set fdexcep;
@@ -1249,18 +1249,19 @@ bool CCurlFile::CReadState::FillBuffer(unsigned int want)
1249 1249
 
1250 1250
             CLog::Log(LOGWARNING, "%s: curl failed with code %i", __FUNCTION__, msg->data.result);
1251 1251
 
1252  
-            // We need to check the data.result here as we don't want to retry on every error
  1252
+            // We need to check the result here as we don't want to retry on every error
1253 1253
             if ( (msg->data.result == CURLE_OPERATION_TIMEDOUT ||
1254 1254
                   msg->data.result == CURLE_PARTIAL_FILE       ||
  1255
+                  msg->data.result == CURLE_COULDNT_CONNECT    ||
1255 1256
                   msg->data.result == CURLE_RECV_ERROR)        &&
1256 1257
                   !m_bFirstLoop)
1257  
-              CURLresult=msg->data.result;
  1258
+              CURLresult = msg->data.result;
1258 1259
             else
1259 1260
               return false;
1260 1261
           }
1261 1262
         }
1262 1263
 
1263  
-        // Don't retry, when we didn't "see" any error
  1264
+        // Don't retry when we didn't "see" any error
1264 1265
         if (CURLresult == CURLE_OK)
1265 1266
           return false;
1266 1267
 
@@ -1286,7 +1287,7 @@ bool CCurlFile::CReadState::FillBuffer(unsigned int want)
1286 1287
           return false;
1287 1288
         }
1288 1289
 
1289  
-        CLog::Log(LOGDEBUG, "%s: Reconnect, (re)try %i", __FUNCTION__, retry);
  1290
+        CLog::Log(LOGWARNING, "%s: Reconnect, (re)try %i", __FUNCTION__, retry);
1290 1291
 
1291 1292
         // Connect + seek to current position (again)
1292 1293
         g_curlInterface.easy_setopt(m_easyHandle, CURLOPT_RESUME_FROM_LARGE, m_filePos);

0 notes on commit d70bd10

Please sign in to comment.
Something went wrong with that request. Please try again.