Commit fec566aa authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

src: Send out data in output buffer before HTTP2/SPDY session tear down

parent 8cb92fc2
......@@ -315,7 +315,8 @@ int Http2Handler::on_read()
}
if(rv == 0) {
if(nghttp2_session_want_read(session_) == 0 &&
nghttp2_session_want_write(session_) == 0) {
nghttp2_session_want_write(session_) == 0 &&
evbuffer_get_length(bufferevent_get_output(bev_)) == 0) {
rv = -1;
}
}
......@@ -331,7 +332,8 @@ int Http2Handler::on_write()
}
if(rv == 0) {
if(nghttp2_session_want_read(session_) == 0 &&
nghttp2_session_want_write(session_) == 0) {
nghttp2_session_want_write(session_) == 0 &&
evbuffer_get_length(bufferevent_get_output(bev_)) == 0) {
rv = -1;
}
}
......
......@@ -508,7 +508,8 @@ struct HttpClient {
}
if(rv == 0) {
if(nghttp2_session_want_read(session) == 0 &&
nghttp2_session_want_write(session) == 0) {
nghttp2_session_want_write(session) == 0 &&
evbuffer_get_length(bufferevent_get_output(bev)) == 0) {
rv = -1;
}
}
......@@ -524,7 +525,8 @@ struct HttpClient {
}
if(rv == 0) {
if(nghttp2_session_want_read(session) == 0 &&
nghttp2_session_want_write(session) == 0) {
nghttp2_session_want_write(session) == 0 &&
evbuffer_get_length(bufferevent_get_output(bev)) == 0) {
rv = -1;
}
}
......
......@@ -403,7 +403,8 @@ int Http2Upstream::on_read()
}
if(rv == 0) {
if(nghttp2_session_want_read(session_) == 0 &&
nghttp2_session_want_write(session_) == 0) {
nghttp2_session_want_write(session_) == 0 &&
evbuffer_get_length(bufferevent_get_output(handler_->get_bev())) == 0) {
if(LOG_ENABLED(INFO)) {
ULOG(INFO, this) << "No more read/write for this SPDY session";
}
......@@ -428,7 +429,8 @@ int Http2Upstream::send()
}
if(rv == 0) {
if(nghttp2_session_want_read(session_) == 0 &&
nghttp2_session_want_write(session_) == 0) {
nghttp2_session_want_write(session_) == 0 &&
evbuffer_get_length(bufferevent_get_output(handler_->get_bev())) == 0) {
if(LOG_ENABLED(INFO)) {
ULOG(INFO, this) << "No more read/write for this SPDY session";
}
......
......@@ -1109,7 +1109,8 @@ int SpdySession::on_read()
}
if(rv == 0) {
if(nghttp2_session_want_read(session_) == 0 &&
nghttp2_session_want_write(session_) == 0) {
nghttp2_session_want_write(session_) == 0 &&
evbuffer_get_length(bufferevent_get_output(bev_)) == 0) {
if(LOG_ENABLED(INFO)) {
SSLOG(INFO, this) << "No more read/write for this session";
}
......@@ -1133,7 +1134,8 @@ int SpdySession::send()
}
if(rv == 0) {
if(nghttp2_session_want_read(session_) == 0 &&
nghttp2_session_want_write(session_) == 0) {
nghttp2_session_want_write(session_) == 0 &&
evbuffer_get_length(bufferevent_get_output(bev_)) == 0) {
if(LOG_ENABLED(INFO)) {
SSLOG(INFO, this) << "No more read/write for this session";
}
......
......@@ -407,7 +407,8 @@ int SpdyUpstream::on_read()
}
if(rv == 0) {
if(spdylay_session_want_read(session_) == 0 &&
spdylay_session_want_write(session_) == 0) {
spdylay_session_want_write(session_) == 0 &&
evbuffer_get_length(bufferevent_get_output(handler_->get_bev())) == 0) {
if(LOG_ENABLED(INFO)) {
ULOG(INFO, this) << "No more read/write for this SPDY session";
}
......@@ -432,7 +433,8 @@ int SpdyUpstream::send()
}
if(rv == 0) {
if(spdylay_session_want_read(session_) == 0 &&
spdylay_session_want_write(session_) == 0) {
spdylay_session_want_write(session_) == 0 &&
evbuffer_get_length(bufferevent_get_output(handler_->get_bev())) == 0) {
if(LOG_ENABLED(INFO)) {
ULOG(INFO, this) << "No more read/write for this SPDY session";
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment