nghttpx: Fix stalled backend connection on retry
This commit is contained in:
parent
16bc11e670
commit
daca43f0dd
|
@ -92,7 +92,8 @@ void connect_timeoutcb(struct ev_loop *loop, ev_timer *w, int revents) {
|
||||||
int rv;
|
int rv;
|
||||||
auto ndconn = handler->get_downstream_connection(rv, downstream);
|
auto ndconn = handler->get_downstream_connection(rv, downstream);
|
||||||
if (ndconn) {
|
if (ndconn) {
|
||||||
if (downstream->attach_downstream_connection(std::move(ndconn)) == 0) {
|
if (downstream->attach_downstream_connection(std::move(ndconn)) == 0 &&
|
||||||
|
downstream->push_request_headers() == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -142,7 +143,8 @@ void backend_retry(Downstream *downstream) {
|
||||||
int rv;
|
int rv;
|
||||||
auto ndconn = handler->get_downstream_connection(rv, downstream);
|
auto ndconn = handler->get_downstream_connection(rv, downstream);
|
||||||
if (ndconn) {
|
if (ndconn) {
|
||||||
if (downstream->attach_downstream_connection(std::move(ndconn)) == 0) {
|
if (downstream->attach_downstream_connection(std::move(ndconn)) == 0 &&
|
||||||
|
downstream->push_request_headers() == 0) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -483,6 +485,7 @@ int HttpDownstreamConnection::initiate_connection() {
|
||||||
|
|
||||||
int HttpDownstreamConnection::push_request_headers() {
|
int HttpDownstreamConnection::push_request_headers() {
|
||||||
if (downstream_->get_request_header_sent()) {
|
if (downstream_->get_request_header_sent()) {
|
||||||
|
signal_write();
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue