From a44fcb2e2e2c86ed1436814c8488d3d824af382b Mon Sep 17 00:00:00 2001 From: Bas Prins Date: Fri, 12 Nov 2021 23:11:22 +0100 Subject: [PATCH] http_client: reset timeout when receiving data This fixes downloads longer than 15 seconds. See bug #60787 (http_client does not reset timeout counter) Signed-off-by: Simon Goldschmidt --- src/apps/http/http_client.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/apps/http/http_client.c b/src/apps/http/http_client.c index fcf4901a..1973e79e 100644 --- a/src/apps/http/http_client.c +++ b/src/apps/http/http_client.c @@ -337,6 +337,8 @@ httpc_tcp_recv(void *arg, struct altcp_pcb *pcb, struct pbuf *p, err_t r) } if ((p != NULL) && (req->parse_state == HTTPC_PARSE_RX_DATA)) { req->rx_content_len += p->tot_len; + /* received valid data: reset timeout */ + req->timeout_ticks = HTTPC_POLL_TIMEOUT; if (req->recv_fn != NULL) { /* directly return here: the connection might already be aborted from the callback! */ return req->recv_fn(req->callback_arg, pcb, p, r);