Commit 2f788aa2 authored by Tatsuhiro Tsujikawa's avatar Tatsuhiro Tsujikawa

nghttpx: Return 503 when h1 backend connect attempt failed

parent cee22df0
......@@ -89,7 +89,7 @@ func TestH1H1ConnectFailure(t *testing.T) {
if err != nil {
t.Fatalf("Error st.http1() = %v", err)
}
want := 502
want := 503
if got := res.status; got != want {
t.Errorf("status: %v; want %v", got, want)
}
......@@ -366,7 +366,7 @@ func TestH2H1ConnectFailure(t *testing.T) {
if err != nil {
t.Fatalf("Error st.http2() = %v", err)
}
want := 502
want := 503
if got := res.status; 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 handler = upstream->get_client_handler();
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;
}
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment