From: Timo Sirainen Date: Thu, 16 Oct 2025 17:40:06 +0000 (+0300) Subject: lib-http: Handle HTTP request timeouts in separate data stack frames X-Git-Tag: 2.4.2~31 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ea05ee107c7a28c417915f60c123f1e9cd27688c;p=thirdparty%2Fdovecot%2Fcore.git lib-http: Handle HTTP request timeouts in separate data stack frames --- diff --git a/src/lib-http/http-client-queue.c b/src/lib-http/http-client-queue.c index 533732bec8..7148eb4d6d 100644 --- a/src/lib-http/http-client-queue.c +++ b/src/lib-http/http-client-queue.c @@ -720,14 +720,14 @@ static void http_client_queue_request_timeout(struct http_client_queue *queue) if (i < count) new_to = reqs[i]->timeout_time; - str = t_str_new(64); + str = str_new(default_pool, 64); str_append(str, "Request "); prefix_size = str_len(str); /* Abort all failed request */ reqs = array_get(&failed_requests, &count); i_assert(count > 0); /* At least one request timed out */ - for (i = 0; i < count; i++) { + for (i = 0; i < count; i++) T_BEGIN { struct http_client_request *req = reqs[i]; str_truncate(str, prefix_size); @@ -741,7 +741,8 @@ static void http_client_queue_request_timeout(struct http_client_queue *queue) t_strdup_printf( "Absolute request timeout expired (%s)", str_c(str))); - } + } T_END; + str_free(&str); if (new_to.tv_sec > 0) { e_debug(queue->event, "New timeout");