Skip to content

Commit 274e6f8

Browse files
committed
client: don't advertise keep-alive in uh_header_error()
The function `uh_header_error()` will tear down the connection after sending the HTTP reply message, so update the `connection_close` flag accordingly to avoid incorrectly emitting a `Connection: keep-alive` header. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
1 parent 1e30935 commit 274e6f8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

client.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,9 @@ uh_client_error(struct client *cl, int code, const char *summary, const char *fm
168168

169169
static void uh_header_error(struct client *cl, int code, const char *summary)
170170
{
171+
/* Signal closure to emit the correct connection headers */
172+
cl->request.connection_close = true;
173+
171174
uh_client_error(cl, code, summary, NULL);
172175
uh_connection_close(cl);
173176
}

0 commit comments

Comments
 (0)