shrpx: Check spdylay_session_want_{read,write}

This commit is contained in:
Tatsuhiro Tsujikawa 2012-07-19 01:59:55 +09:00
parent 4bc200f9dc
commit 75f93d8333
1 changed files with 18 additions and 0 deletions

View File

@ -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;
}