diff --git a/src/shrpx_spdy_session.cc b/src/shrpx_spdy_session.cc index c759780d..3c78379a 100644 --- a/src/shrpx_spdy_session.cc +++ b/src/shrpx_spdy_session.cc @@ -24,6 +24,7 @@ */ #include "shrpx_spdy_session.h" +#include #include #include @@ -225,6 +226,10 @@ void eventcb(bufferevent *bev, short events, void *ptr) spdy->disconnect(); return; } + int fd = bufferevent_getfd(bev); + int val = 1; + setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, + reinterpret_cast(&val), sizeof(val)); } else if(events & BEV_EVENT_EOF) { if(ENABLE_LOG) { SSLOG(INFO, spdy) << "EOF"; diff --git a/src/shrpx_spdy_upstream.cc b/src/shrpx_spdy_upstream.cc index 84cf1afa..f2e52950 100644 --- a/src/shrpx_spdy_upstream.cc +++ b/src/shrpx_spdy_upstream.cc @@ -24,6 +24,7 @@ */ #include "shrpx_spdy_upstream.h" +#include #include #include #include @@ -505,6 +506,10 @@ void spdy_downstream_eventcb(bufferevent *bev, short events, void *ptr) DCLOG(INFO, dconn) << "Connection established. stream_id=" << downstream->get_stream_id(); } + int fd = bufferevent_getfd(bev); + int val = 1; + setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, + reinterpret_cast(&val), sizeof(val)); } else if(events & BEV_EVENT_EOF) { if(ENABLE_LOG) { DCLOG(INFO, dconn) << "EOF. stream_id=" << downstream->get_stream_id();