nghttpx: Fix crash in http/1 backend when backend returns more bytes than CL
This is typically programming mistake that we did not check return value before doing another.
This commit is contained in:
parent
c506386997
commit
7f9de007d0
|
@ -455,6 +455,14 @@ int HttpsUpstream::downstream_read(DownstreamConnection *dconn) {
|
|||
|
||||
rv = downstream->on_read();
|
||||
|
||||
if (rv == SHRPX_ERR_EOF) {
|
||||
return downstream_eof(dconn);
|
||||
}
|
||||
|
||||
if (rv < 0) {
|
||||
return downstream_error(dconn, Downstream::EVENT_ERROR);
|
||||
}
|
||||
|
||||
if (downstream->get_response_state() == Downstream::MSG_RESET) {
|
||||
return -1;
|
||||
}
|
||||
|
@ -473,14 +481,6 @@ int HttpsUpstream::downstream_read(DownstreamConnection *dconn) {
|
|||
downstream->detach_downstream_connection();
|
||||
}
|
||||
|
||||
if (rv == SHRPX_ERR_EOF) {
|
||||
return downstream_eof(dconn);
|
||||
}
|
||||
|
||||
if (rv < 0) {
|
||||
return downstream_error(dconn, Downstream::EVENT_ERROR);
|
||||
}
|
||||
|
||||
end:
|
||||
handler_->signal_write();
|
||||
|
||||
|
|
Loading…
Reference in New Issue