nghttpx: Remove dead handling of Downstream::STREAM_CLOSED

This commit is contained in:
Tatsuhiro Tsujikawa 2015-07-15 23:33:44 +09:00
parent fc062976a1
commit ba31b990a2
2 changed files with 0 additions and 50 deletions

View File

@ -884,16 +884,6 @@ ClientHandler *Http2Upstream::get_client_handler() const { return handler_; }
int Http2Upstream::downstream_read(DownstreamConnection *dconn) { int Http2Upstream::downstream_read(DownstreamConnection *dconn) {
auto downstream = dconn->get_downstream(); auto downstream = dconn->get_downstream();
if (downstream->get_request_state() == Downstream::STREAM_CLOSED) {
// If upstream HTTP2 stream was closed, we just close downstream,
// because there is no consumer now. Downstream connection is also
// closed in this case.
remove_downstream(downstream);
// downstream was deleted
return 0;
}
if (downstream->get_response_state() == Downstream::MSG_RESET) { if (downstream->get_response_state() == Downstream::MSG_RESET) {
// The downstream stream was reset (canceled). In this case, // The downstream stream was reset (canceled). In this case,
// RST_STREAM to the upstream and delete downstream connection // RST_STREAM to the upstream and delete downstream connection
@ -959,14 +949,6 @@ int Http2Upstream::downstream_eof(DownstreamConnection *dconn) {
if (LOG_ENABLED(INFO)) { if (LOG_ENABLED(INFO)) {
DCLOG(INFO, dconn) << "EOF. stream_id=" << downstream->get_stream_id(); DCLOG(INFO, dconn) << "EOF. stream_id=" << downstream->get_stream_id();
} }
if (downstream->get_request_state() == Downstream::STREAM_CLOSED) {
// If stream was closed already, we don't need to send reply at
// the first place. We can delete downstream.
remove_downstream(downstream);
// downstream was deleted
return 0;
}
// Delete downstream connection. If we don't delete it here, it will // Delete downstream connection. If we don't delete it here, it will
// be pooled in on_stream_close_callback. // be pooled in on_stream_close_callback.
@ -1012,13 +994,6 @@ int Http2Upstream::downstream_error(DownstreamConnection *dconn, int events) {
} }
} }
if (downstream->get_request_state() == Downstream::STREAM_CLOSED) {
remove_downstream(downstream);
// downstream was deleted
return 0;
}
// Delete downstream connection. If we don't delete it here, it will // Delete downstream connection. If we don't delete it here, it will
// be pooled in on_stream_close_callback. // be pooled in on_stream_close_callback.
downstream->pop_downstream_connection(); downstream->pop_downstream_connection();

View File

@ -560,16 +560,6 @@ ClientHandler *SpdyUpstream::get_client_handler() const { return handler_; }
int SpdyUpstream::downstream_read(DownstreamConnection *dconn) { int SpdyUpstream::downstream_read(DownstreamConnection *dconn) {
auto downstream = dconn->get_downstream(); auto downstream = dconn->get_downstream();
if (downstream->get_request_state() == Downstream::STREAM_CLOSED) {
// If upstream SPDY stream was closed, we just close downstream,
// because there is no consumer now. Downstream connection is also
// closed in this case.
remove_downstream(downstream);
// downstrea was deleted
return 0;
}
if (downstream->get_response_state() == Downstream::MSG_RESET) { if (downstream->get_response_state() == Downstream::MSG_RESET) {
// The downstream stream was reset (canceled). In this case, // The downstream stream was reset (canceled). In this case,
// RST_STREAM to the upstream and delete downstream connection // RST_STREAM to the upstream and delete downstream connection
@ -633,14 +623,6 @@ int SpdyUpstream::downstream_eof(DownstreamConnection *dconn) {
if (LOG_ENABLED(INFO)) { if (LOG_ENABLED(INFO)) {
DCLOG(INFO, dconn) << "EOF. stream_id=" << downstream->get_stream_id(); DCLOG(INFO, dconn) << "EOF. stream_id=" << downstream->get_stream_id();
} }
if (downstream->get_request_state() == Downstream::STREAM_CLOSED) {
// If stream was closed already, we don't need to send reply at
// the first place. We can delete downstream.
remove_downstream(downstream);
// downstream was deleted
return 0;
}
// Delete downstream connection. If we don't delete it here, it will // Delete downstream connection. If we don't delete it here, it will
// be pooled in on_stream_close_callback. // be pooled in on_stream_close_callback.
@ -686,13 +668,6 @@ int SpdyUpstream::downstream_error(DownstreamConnection *dconn, int events) {
} }
} }
if (downstream->get_request_state() == Downstream::STREAM_CLOSED) {
remove_downstream(downstream);
// downstream was deleted
return 0;
}
// Delete downstream connection. If we don't delete it here, it will // Delete downstream connection. If we don't delete it here, it will
// be pooled in on_stream_close_callback. // be pooled in on_stream_close_callback.
downstream->pop_downstream_connection(); downstream->pop_downstream_connection();