소스 검색

V0.7.4
1、CurlFtp添加了超时时间

Apple 2 달 전
부모
커밋
58cd894092
1개의 변경된 파일4개의 추가작업 그리고 4개의 파일을 삭제
  1. 4 4
      module/CurlFtp/CurlFtp.cpp

+ 4 - 4
module/CurlFtp/CurlFtp.cpp

@@ -779,7 +779,7 @@ bool CurlFtp::downloadFile(const std::string& remoteFile, const std::string& loc
     curl_easy_setopt(m_curl, CURLOPT_WRITEFUNCTION, writeFileCallBack);
     curl_easy_setopt(m_curl, CURLOPT_WRITEDATA, &ofs);
     /* 设置超时时间 */
-    // curl_easy_setopt(curl, CURLOPT_TIMEOUT, 30L);
+    curl_easy_setopt(m_curl, CURLOPT_TIMEOUT, timeout);
     curl_easy_setopt(m_curl, CURLOPT_CONNECTTIMEOUT, timeout);
     /* 设置进度回调函数 */
     curl_easy_setopt(m_curl, CURLOPT_XFERINFOFUNCTION, progress_callback);
@@ -854,7 +854,7 @@ bool CurlFtp::downloadToArray(const std::string& remoteFile, std::vector<char>&
     curl_easy_setopt(m_curl, CURLOPT_WRITEFUNCTION, writeDataCallBack);
     curl_easy_setopt(m_curl, CURLOPT_WRITEDATA, &arrayInfo);
     /* 设置超时时间 */
-    // curl_easy_setopt(curl, CURLOPT_TIMEOUT, 30L);
+    curl_easy_setopt(m_curl, CURLOPT_TIMEOUT, timeout);
     curl_easy_setopt(m_curl, CURLOPT_CONNECTTIMEOUT, timeout);
     /* 设置进度回调函数 */
     curl_easy_setopt(m_curl, CURLOPT_XFERINFOFUNCTION, progress_callback);
@@ -982,7 +982,7 @@ bool CurlFtp::uploadFile(const std::string& localFile, const std::string& remote
     /* 设置上传文件的大小 */
     curl_easy_setopt(m_curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)fileSize);
     /* 设置超时时间 */
-    // curl_easy_setopt(curl, CURLOPT_TIMEOUT, 30L);
+    curl_easy_setopt(m_curl, CURLOPT_TIMEOUT, timeout);
     curl_easy_setopt(m_curl, CURLOPT_CONNECTTIMEOUT, timeout);
     /* 设置进度回调函数 */
     curl_easy_setopt(m_curl, CURLOPT_XFERINFOFUNCTION, progress_callback);
@@ -1093,7 +1093,7 @@ bool CurlFtp::uploadData(char* srcData, size_t size, const std::string& remoteFi
     /* 设置上传文件的大小 */
     curl_easy_setopt(m_curl, CURLOPT_INFILESIZE_LARGE, (curl_off_t)arrayInfo.size);
     /* 设置超时时间 */
-    // curl_easy_setopt(curl, CURLOPT_TIMEOUT, 30L);
+    curl_easy_setopt(m_curl, CURLOPT_TIMEOUT, timeout);
     curl_easy_setopt(m_curl, CURLOPT_CONNECTTIMEOUT, timeout);
     /* 设置进度回调函数 */
     curl_easy_setopt(m_curl, CURLOPT_XFERINFOFUNCTION, progress_callback);