Fix bug in response builder state machine
This commit is contained in:
@@ -4901,7 +4901,7 @@ void http_response_builder_body_cap(HTTP_ResponseBuilder builder, int cap)
|
|||||||
if (conn == NULL)
|
if (conn == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (conn->state != HTTP_SERVER_CONN_WAIT_HEADER) {
|
if (conn->state == HTTP_SERVER_CONN_WAIT_HEADER) {
|
||||||
append_special_headers(conn);
|
append_special_headers(conn);
|
||||||
conn->state = HTTP_SERVER_CONN_WAIT_BODY;
|
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)
|
if (conn == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (conn->state != HTTP_SERVER_CONN_WAIT_HEADER) {
|
if (conn->state == HTTP_SERVER_CONN_WAIT_HEADER) {
|
||||||
append_special_headers(conn);
|
append_special_headers(conn);
|
||||||
conn->state = HTTP_SERVER_CONN_WAIT_BODY;
|
conn->state = HTTP_SERVER_CONN_WAIT_BODY;
|
||||||
}
|
}
|
||||||
|
|||||||
+2
-2
@@ -503,7 +503,7 @@ void http_response_builder_body_cap(HTTP_ResponseBuilder builder, int cap)
|
|||||||
if (conn == NULL)
|
if (conn == NULL)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (conn->state != HTTP_SERVER_CONN_WAIT_HEADER) {
|
if (conn->state == HTTP_SERVER_CONN_WAIT_HEADER) {
|
||||||
append_special_headers(conn);
|
append_special_headers(conn);
|
||||||
conn->state = HTTP_SERVER_CONN_WAIT_BODY;
|
conn->state = HTTP_SERVER_CONN_WAIT_BODY;
|
||||||
}
|
}
|
||||||
@@ -520,7 +520,7 @@ char *http_response_builder_body_buf(HTTP_ResponseBuilder builder, int *cap)
|
|||||||
if (conn == NULL)
|
if (conn == NULL)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
if (conn->state != HTTP_SERVER_CONN_WAIT_HEADER) {
|
if (conn->state == HTTP_SERVER_CONN_WAIT_HEADER) {
|
||||||
append_special_headers(conn);
|
append_special_headers(conn);
|
||||||
conn->state = HTTP_SERVER_CONN_WAIT_BODY;
|
conn->state = HTTP_SERVER_CONN_WAIT_BODY;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user