From 9425f8a45f306c1d2bee59d05bd829074ac359e0 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 17 Dec 2012 01:10:45 +0900 Subject: [PATCH] shrpx: Handle graceful shutdown in SPDY backend --- src/shrpx_spdy_session.cc | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/src/shrpx_spdy_session.cc b/src/shrpx_spdy_session.cc index 4dda0d9a..c759780d 100644 --- a/src/shrpx_spdy_session.cc +++ b/src/shrpx_spdy_session.cc @@ -843,15 +843,15 @@ int SpdySession::on_read() SSLOG(ERROR, this) << "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; - // } - // } + if(rv == 0) { + if(spdylay_session_want_read(session_) == 0 && + spdylay_session_want_write(session_) == 0) { + if(ENABLE_LOG) { + SSLOG(INFO, this) << "No more read/write for this session"; + } + rv = -1; + } + } return rv; } @@ -867,15 +867,15 @@ int SpdySession::send() SSLOG(ERROR, this) << "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; - // } - // } + if(rv == 0) { + if(spdylay_session_want_read(session_) == 0 && + spdylay_session_want_write(session_) == 0) { + if(ENABLE_LOG) { + SSLOG(INFO, this) << "No more read/write for this session"; + } + rv = -1; + } + } return rv; }