mirror of
https://github.com/curl/curl.git
synced 2026-08-03 21:20:29 +03:00
CURLOPT_TCP_NODELAY: now enabled by default
After a few wasted hours hunting down the reason for slowness during a TLS handshake that turned out to be because of TCP_NODELAY not being set, I think we have enough motivation to toggle the default for this option. We now enable TCP_NODELAY by default and allow applications to switch it off. This also makes --tcp-nodelay unnecessary, but --no-tcp-nodelay can be used to disable it. Thanks-to: Tim Rühsen Bug: https://curl.haxx.se/mail/lib-2016-06/0143.html
This commit is contained in:
parent
edeabf741f
commit
4732ca5724
6 changed files with 13 additions and 14 deletions
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -41,6 +41,7 @@ void config_init(struct OperationConfig* config)
|
|||
CURLPROTO_SMBS);
|
||||
config->proto_redir_present = FALSE;
|
||||
config->proto_default = NULL;
|
||||
config->tcp_nodelay = TRUE; /* enabled by default */
|
||||
}
|
||||
|
||||
static void free_config_fields(struct OperationConfig *config)
|
||||
|
|
|
|||
|
|
@ -792,8 +792,8 @@ static CURLcode operate_do(struct GlobalConfig *global,
|
|||
set_binmode(stdout);
|
||||
}
|
||||
|
||||
if(config->tcp_nodelay)
|
||||
my_setopt(curl, CURLOPT_TCP_NODELAY, 1L);
|
||||
if(!config->tcp_nodelay)
|
||||
my_setopt(curl, CURLOPT_TCP_NODELAY, 0L);
|
||||
|
||||
if(config->tcp_fastopen)
|
||||
my_setopt(curl, CURLOPT_TCP_FASTOPEN, 1L);
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -157,6 +157,7 @@ static const NameValue setopt_nv_CURLNONZERODEFAULTS[] = {
|
|||
NV1(CURLOPT_SSL_VERIFYHOST, 1),
|
||||
NV1(CURLOPT_SSL_ENABLE_NPN, 1),
|
||||
NV1(CURLOPT_SSL_ENABLE_ALPN, 1),
|
||||
NV1(CURLOPT_TCP_NODELAY, 1),
|
||||
NVEND
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue