bugfix: POST request with keepalive peer cause 400 response

When the POST data sent is incomplete, the peer cannot be reused and should be discarded, otherwise the upstream server will discard some data from next request which use the same peer
This commit is contained in:
董宇
2019-12-08 23:53:25 +08:00
committed by GitHub
parent 7e581f931a
commit fde495754a

View File

@@ -784,6 +784,10 @@ ngx_http_upstream_free_keepalive_peer(ngx_peer_connection_t *pc, void *data,
goto closed;
}
if (!u->request_body_sent) {
goto closed;
}
if (ngx_terminate || ngx_exiting) {
goto closed;
}