【问题标题】:cURL command parameters problem, not retrying the right number of timescURL 命令参数问题,重试次数不正确
【发布时间】:2020-02-13 19:03:46
【问题描述】:

这是我的 cURL 命令:

/usr/bin/curl --ipv4 --connect-timeout 1 --retry 15 --retry-delay 2 --retry-max-time 15 --no-keepalive --no-tcp-nodelay -L --silent 'http://www.example.org' -v --trace-time

当出现网络拥塞问题时,它不会重试指定的次数...这是我得到的输出:

13:29:01.884487 *   Trying 104.18.47.34... 
13:29:02.382339 * After 498ms connect time, move on! 
13:29:02.382512 * connect to 104.18.47.34 port 80 failed: Connection timed out 
13:29:02.382595 *   Trying 104.18.46.34... 
13:29:02.631165 * After 248ms connect time, move on! 
13:29:02.631287 * connect to 104.18.46.34 port 80 failed: Connection timed out 
13:29:02.631369 * Failed to connect to www.example.org port 80: Connection timed out
13:29:02.631423 * Closing connection 0

知道我的参数有什么问题吗?

谢谢。

【问题讨论】:

    标签: linux curl command-line


    【解决方案1】:

    问题在于我的 cURL 版本 (7.58)。

    在版本 7.67.0 (https://github.com/curl/curl/issues/4461) 之前,“连接超时”并未正确处理为暂时性错误。

    我将 cURL 升级到了最新的可用版本 (7.68),此后再也没有看到此错误。

    【讨论】:

      猜你喜欢
      • 2015-10-17
      • 2012-11-02
      • 1970-01-01
      • 2020-06-05
      • 2019-11-20
      • 1970-01-01
      相关资源
      最近更新 更多