enable TCP_NODELAY
Costa Tsaousis (ktsaou) committed
May 31, 2016 at 20:11 UTC
c8bc04fdc06cdfaac25b603296f128459b4e8bd3
1 file changed
+4
-4
src/web_client.c
+4
-4
@@ -1726,11 +1726,11 @@ void web_client_process(struct web_client *w) {
1726
1727
buffer_strcat(w->response.header_output, "\r\n");
1728
1729
-/* // disable TCP_NODELAY, to buffer the header
1729
+ // disable TCP_NODELAY, to buffer the header
1730
int flag = 0;
1731
if(setsockopt(w->ofd, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(int)) != 0)
1732
error("%llu: failed to disable TCP_NODELAY on socket.", w->id);
1733
-*/
1733
+
1734
// sent the HTTP header
1735
debug(D_WEB_DATA, "%llu: Sending response HTTP header of size %d: '%s'"
1736
, w->id
@@ -1752,11 +1752,11 @@ void web_client_process(struct web_client *w) {
1752
else
1753
w->stats_sent_bytes += bytes;
1754
1755
-/* // enable TCP_NODELAY, to send all data immediately at the next send()
1755
+ // enable TCP_NODELAY, to send all data immediately at the next send()
1756
flag = 1;
1757
if(setsockopt(w->ofd, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(int)) != 0)
1758
error("%llu: failed to enable TCP_NODELAY on socket.", w->id);
1759
-*/
1759
+
1760
// enable sending immediately if we have data
1761
if(w->response.data->len) w->wait_send = 1;
1762
else w->wait_send = 0;