nghttpx: Better handling EOF from downstream connection to tunnel stream
This commit is contained in:
parent
8a0fdcfea9
commit
1d7601edfb
|
@ -1015,7 +1015,11 @@ void downstream_eventcb(bufferevent *bev, short events, void *ptr)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(downstream->get_response_state() == Downstream::HEADER_COMPLETE) {
|
if(downstream->get_response_state() == Downstream::HEADER_COMPLETE) {
|
||||||
|
if(downstream->get_upgraded()) {
|
||||||
|
upstream->on_downstream_body_complete(downstream);
|
||||||
|
} else {
|
||||||
upstream->rst_stream(downstream, NGHTTP2_INTERNAL_ERROR);
|
upstream->rst_stream(downstream, NGHTTP2_INTERNAL_ERROR);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
unsigned int status;
|
unsigned int status;
|
||||||
if(events & BEV_EVENT_TIMEOUT) {
|
if(events & BEV_EVENT_TIMEOUT) {
|
||||||
|
@ -1102,9 +1106,10 @@ ssize_t downstream_data_read_callback(nghttp2_session *session,
|
||||||
if(nread == 0 &&
|
if(nread == 0 &&
|
||||||
downstream->get_response_state() == Downstream::MSG_COMPLETE) {
|
downstream->get_response_state() == Downstream::MSG_COMPLETE) {
|
||||||
|
|
||||||
if(!downstream->get_upgraded()) {
|
|
||||||
*data_flags |= NGHTTP2_DATA_FLAG_EOF;
|
*data_flags |= NGHTTP2_DATA_FLAG_EOF;
|
||||||
|
|
||||||
|
if(!downstream->get_upgraded()) {
|
||||||
|
|
||||||
upstream_accesslog(upstream->get_client_handler()->get_ipaddr(),
|
upstream_accesslog(upstream->get_client_handler()->get_ipaddr(),
|
||||||
downstream->get_response_http_status(),
|
downstream->get_response_http_status(),
|
||||||
downstream);
|
downstream);
|
||||||
|
|
Loading…
Reference in New Issue