diff --git a/src/shrpx_spdy_downstream_connection.cc b/src/shrpx_spdy_downstream_connection.cc index f836706b..29dca1ca 100644 --- a/src/shrpx_spdy_downstream_connection.cc +++ b/src/shrpx_spdy_downstream_connection.cc @@ -190,6 +190,11 @@ ssize_t spdy_data_read_callback(spdylay_session *session, // In this case, downstream may be deleted. return SPDYLAY_ERR_DEFERRED; } + // Check dconn is still alive because Upstream::resume_read() + // may delete downstream which will delete dconn. + if(sd->dconn == 0) { + return SPDYLAY_ERR_DEFERRED; + } if(evbuffer_get_length(body) == 0) { return SPDYLAY_ERR_DEFERRED; } diff --git a/src/shrpx_spdy_upstream.cc b/src/shrpx_spdy_upstream.cc index 5193c809..ad602285 100644 --- a/src/shrpx_spdy_upstream.cc +++ b/src/shrpx_spdy_upstream.cc @@ -898,7 +898,7 @@ int SpdyUpstream::resume_read(IOCtrlReason reason, Downstream *downstream) window_update(downstream); } } - return 0; + return send(); } } // namespace shrpx