From 75f93d8333b75f1e7cc3223efd7a9c59e87c545e Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Thu, 19 Jul 2012 01:59:55 +0900 Subject: [PATCH] shrpx: Check spdylay_session_want_{read,write} --- examples/shrpx_spdy_upstream.cc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/examples/shrpx_spdy_upstream.cc b/examples/shrpx_spdy_upstream.cc index 7fe4524..5f63f30 100644 --- a/examples/shrpx_spdy_upstream.cc +++ b/examples/shrpx_spdy_upstream.cc @@ -339,6 +339,15 @@ int SpdyUpstream::on_read() LOG(ERROR) << "spdylay_session_send() returned error: " << spdylay_strerror(rv); } + if(rv == 0) { + if(spdylay_session_want_read(session_) == 0 && + spdylay_session_want_write(session_) == 0) { + if(ENABLE_LOG) { + LOG(INFO) << "No more read/write for this SPDY session"; + } + rv = -1; + } + } return rv; } @@ -355,6 +364,15 @@ int SpdyUpstream::send() LOG(ERROR) << "spdylay_session_send() returned error: " << spdylay_strerror(rv); } + if(rv == 0) { + if(spdylay_session_want_read(session_) == 0 && + spdylay_session_want_write(session_) == 0) { + if(ENABLE_LOG) { + LOG(INFO) << "No more read/write for this SPDY session"; + } + rv = -1; + } + } return rv; }