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.
This commit is contained in:
Joris Vink 2022-09-01 12:09:15 +02:00
parent b3c5ce8375
commit 5dcf3d1550
1 changed files with 2 additions and 0 deletions

View File

@ -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;