commit 5dcf3d1550bd72f05c2f543e7e83cb09ab6a86b5
parent b3c5ce8375d28ff8bd964ba8021598fc9de023c3
Author: Joris Vink <joris@coders.se>
Date: Thu, 1 Sep 2022 12:09:15 +0200
Fix a problem with http_timeout when a body is sent.
When receiving an HTTP body, Kore never reset http_timeout once
the transfer was done.
This can result in a 408 being thrown by Kore while a request is
activity running.
Diffstat:
1 file changed, 2 insertions(+), 0 deletions(-)
diff --git a/src/http.c b/src/http.c
@@ -919,6 +919,7 @@ http_header_recv(struct netbuf *nb)
}
if (req->content_length == 0) {
+ c->http_timeout = 0;
req->flags |= HTTP_REQUEST_COMPLETE;
req->flags &= ~HTTP_REQUEST_EXPECT_BODY;
return (KORE_RESULT_OK);
@@ -2342,6 +2343,7 @@ http_body_update(struct http_request *req, const void *data, size_t len)
req->content_length -= len;
if (req->content_length == 0) {
+ req->owner->http_timeout = 0;
req->owner->rnb->extra = NULL;
http_request_wakeup(req);
req->flags |= HTTP_REQUEST_COMPLETE;