nghttpx: Return 503 when h1 backend connect attempt failed
This commit is contained in:
parent
cee22df073
commit
2f788aa214
|
@ -89,7 +89,7 @@ func TestH1H1ConnectFailure(t *testing.T) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Error st.http1() = %v", err)
|
t.Fatalf("Error st.http1() = %v", err)
|
||||||
}
|
}
|
||||||
want := 502
|
want := 503
|
||||||
if got := res.status; got != want {
|
if got := res.status; got != want {
|
||||||
t.Errorf("status: %v; want %v", got, want)
|
t.Errorf("status: %v; want %v", got, want)
|
||||||
}
|
}
|
||||||
|
@ -366,7 +366,7 @@ func TestH2H1ConnectFailure(t *testing.T) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatalf("Error st.http2() = %v", err)
|
t.Fatalf("Error st.http2() = %v", err)
|
||||||
}
|
}
|
||||||
want := 502
|
want := 503
|
||||||
if got := res.status; got != want {
|
if got := res.status; got != want {
|
||||||
t.Errorf("status: %v; want %v", got, want)
|
t.Errorf("status: %v; want %v", got, want)
|
||||||
}
|
}
|
||||||
|
|
|
@ -95,7 +95,7 @@ void connectcb(struct ev_loop *loop, ev_io *w, int revents) {
|
||||||
auto upstream = downstream->get_upstream();
|
auto upstream = downstream->get_upstream();
|
||||||
auto handler = upstream->get_client_handler();
|
auto handler = upstream->get_client_handler();
|
||||||
if (dconn->on_connect() != 0) {
|
if (dconn->on_connect() != 0) {
|
||||||
if (upstream->downstream_error(dconn, Downstream::EVENT_ERROR) != 0) {
|
if (upstream->on_downstream_abort_request(downstream, 503) != 0) {
|
||||||
delete handler;
|
delete handler;
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue