OSDN Git Service

[Fix] CURLOPT_TIMEOUT によりダウンロードが中断する
authorHabu <habu1010+github@gmail.com>
Sat, 1 Jul 2023 09:49:30 +0000 (18:49 +0900)
committerHabu <habu1010+github@gmail.com>
Sat, 1 Jul 2023 11:17:10 +0000 (20:17 +0900)
CURLOPT_TIMEOUT は通信が継続しているかどうかによらず、オペレーションの
経過時間により強制的にタイムアウトにより中断するオプションなので、大きな
コンテンツをダウンロードしていてこの時間が経過するとダウンロードが中断
されてしまう。
これを避けるため、CURLOPT_TIMEOUT は設定しないように変更する。

src/net/curl-easy-session.cpp

index dbbf1f1..ef12b06 100644 (file)
@@ -57,7 +57,6 @@ void EasySession::common_setup(const std::string &url, int timeout_sec)
 
     if (timeout_sec > 0) {
         this->setopt(CURLOPT_CONNECTTIMEOUT, timeout_sec);
-        this->setopt(CURLOPT_TIMEOUT, timeout_sec);
     }
 }