]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: Handle HTTP request timeouts in separate data stack frames
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Thu, 16 Oct 2025 17:40:06 +0000 (20:40 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Tue, 21 Oct 2025 11:03:24 +0000 (11:03 +0000)
src/lib-http/http-client-queue.c

index 533732bec8fa52050316508feae5be39def15fe4..7148eb4d6df15d4a401d5b1263bfc95bc9d0879b 100644 (file)
@@ -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");