build: disable TCP_NODELAY for emscripten

This commit is contained in:
Viktor Szakats 2025-08-03 23:48:53 +02:00
parent 38672f2eaf
commit a41a9bfbed
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201
3 changed files with 6 additions and 6 deletions

View file

@ -109,7 +109,7 @@ static void set_ipv6_v6only(curl_socket_t sockfd, int on)
static void tcpnodelay(struct Curl_easy *data, curl_socket_t sockfd)
{
#ifdef TCP_NODELAY
#if defined(TCP_NODELAY) && !defined(__EMSCRIPTEN__)
curl_socklen_t onoff = (curl_socklen_t) 1;
int level = IPPROTO_TCP;
char buffer[STRERROR_LEN];

View file

@ -1224,7 +1224,7 @@ static int test_rtspd(int argc, char *argv[])
logmsg("====> Client connect");
#ifdef TCP_NODELAY
#if defined(TCP_NODELAY) && !defined(__EMSCRIPTEN__)
/*
* Disable the Nagle algorithm to make it easier to send out a large
* response in many small segments to torture the clients more.

View file

@ -158,7 +158,7 @@ static const char *doc404 = "HTTP/1.1 404 Not Found\r\n"
/* work around for handling trailing headers */
static int already_recv_zeroed_chunk = FALSE;
#ifdef TCP_NODELAY
#if defined(TCP_NODELAY) && !defined(__EMSCRIPTEN__)
/* returns true if the current socket is an IP one */
static bool socket_domain_is_ip(void)
{
@ -1239,7 +1239,7 @@ static curl_socket_t connect_to(const char *ipaddr, unsigned short port)
return CURL_SOCKET_BAD;
}
#ifdef TCP_NODELAY
#if defined(TCP_NODELAY) && !defined(__EMSCRIPTEN__)
if(socket_domain_is_ip()) {
/* Disable the Nagle algorithm */
curl_socklen_t flag = 1;
@ -1545,7 +1545,7 @@ static void http_connect(curl_socket_t *infdp,
}
memset(req2, 0, sizeof(*req2));
logmsg("====> Client connect DATA");
#ifdef TCP_NODELAY
#if defined(TCP_NODELAY) && !defined(__EMSCRIPTEN__)
if(socket_domain_is_ip()) {
/* Disable the Nagle algorithm */
curl_socklen_t flag = 1;
@ -1871,7 +1871,7 @@ static curl_socket_t accept_connection(curl_socket_t sock)
all_sockets[num_sockets] = msgsock;
num_sockets += 1;
#ifdef TCP_NODELAY
#if defined(TCP_NODELAY) && !defined(__EMSCRIPTEN__)
if(socket_domain_is_ip()) {
/*
* Disable the Nagle algorithm to make it easier to send out a large