gpt4 book ai didi

curl - 如何禁用命令行 Curl TCP_NODELAY 选项?

转载 作者:行者123 更新时间:2023-12-01 21:55:44 30 4
gpt4 key购买 nike

我正在诊断一个奇怪的网络问题,(我认为)我已经缩小到行为不当的 HTTP 客户端或服务器以及一些 HTTP1.1 流水线和/或 Nagle 的算法交互。我试图在 curl 中禁用 TCP_NODELAY 作为测试。

Curl 的手册页说:

--tcp-nodelay
Turn on the TCP_NODELAY option. See the curl_easy_setopt(3) man page for details about this option.

Since 7.50.2, curl sets this option by default and you need to explicitly switch it off if you don't want it on.

Added in 7.11.2.

然后它从不解释如何明确地关闭它。我尝试在环境中设置 export CURLOPT_TCP_NODELAY=0,但 curl 在其输出中仍然提到:

* TCP_NODELAY set

搜索互联网或 Stackoverflow 也没有给我答案。

那么我怎样才能关闭它呢?

最佳答案

我应该更好地阅读手册。它说:

In  general,  all boolean options are enabled with --option and yet again
disabled with --no-option. That is, you use the exact same option name but
prefix it with "no-". However, in this list we mostly only list and show
the --option version of them. (This concept with --no options was added in
7.19.0. Previously most options were toggled on/off on repeated use
of the same command line option.)

所以我可以通过以下方式禁用 TCP_NODELAY:

curl -v --no-tcp-nodelay <url>

并且输出不再包含 TCP_NODELAY set 消息。

关于curl - 如何禁用命令行 Curl TCP_NODELAY 选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57398807/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com