diff options
author | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2016-05-31 20:11:08 +0300 |
---|---|---|
committer | Costa Tsaousis (ktsaou) <costa@tsaousis.gr> | 2016-05-31 20:11:08 +0300 |
commit | c8bc04fdc06cdfaac25b603296f128459b4e8bd3 (patch) | |
tree | c7c84fa214ef33e1101097b0106668c4371e9834 /src/web_client.c | |
parent | 980e3aac58c743ab9988be9e4ca69171ecbcfbbe (diff) |
enable TCP_NODELAY
Diffstat (limited to 'src/web_client.c')
-rw-r--r-- | src/web_client.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/web_client.c b/src/web_client.c index 660d7c656a..dc3bbea2b5 100644 --- a/src/web_client.c +++ b/src/web_client.c @@ -1726,11 +1726,11 @@ void web_client_process(struct web_client *w) { buffer_strcat(w->response.header_output, "\r\n"); -/* // disable TCP_NODELAY, to buffer the header + // disable TCP_NODELAY, to buffer the header int flag = 0; if(setsockopt(w->ofd, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(int)) != 0) error("%llu: failed to disable TCP_NODELAY on socket.", w->id); -*/ + // sent the HTTP header debug(D_WEB_DATA, "%llu: Sending response HTTP header of size %d: '%s'" , w->id @@ -1752,11 +1752,11 @@ void web_client_process(struct web_client *w) { else w->stats_sent_bytes += bytes; -/* // enable TCP_NODELAY, to send all data immediately at the next send() + // enable TCP_NODELAY, to send all data immediately at the next send() flag = 1; if(setsockopt(w->ofd, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(int)) != 0) error("%llu: failed to enable TCP_NODELAY on socket.", w->id); -*/ + // enable sending immediately if we have data if(w->response.data->len) w->wait_send = 1; else w->wait_send = 0; |