Fix bug in response builder state machine

This commit is contained in:
2025-11-27 21:02:31 +01:00
parent 1ef6187b2d
commit 008772aef1
2 changed files with 4 additions and 4 deletions
+2 -2
View File
@@ -4901,7 +4901,7 @@ void http_response_builder_body_cap(HTTP_ResponseBuilder builder, int cap)
if (conn == NULL)
return;
if (conn->state != HTTP_SERVER_CONN_WAIT_HEADER) {
if (conn->state == HTTP_SERVER_CONN_WAIT_HEADER) {
append_special_headers(conn);
conn->state = HTTP_SERVER_CONN_WAIT_BODY;
}
@@ -4918,7 +4918,7 @@ char *http_response_builder_body_buf(HTTP_ResponseBuilder builder, int *cap)
if (conn == NULL)
return NULL;
if (conn->state != HTTP_SERVER_CONN_WAIT_HEADER) {
if (conn->state == HTTP_SERVER_CONN_WAIT_HEADER) {
append_special_headers(conn);
conn->state = HTTP_SERVER_CONN_WAIT_BODY;
}