]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-http: http-server - Restructure http_server_shut_down() to use while statement
authorStephan Bosch <stephan.bosch@open-xchange.com>
Fri, 21 Aug 2020 19:28:47 +0000 (21:28 +0200)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 7 Mar 2025 14:56:56 +0000 (14:56 +0000)
Original for statement was objectionable to static analyzer. New structure is
equivalent to similar code elsewhere in Dovecot.

src/lib-http/http-server.c

index d0cdf3a57b0cfd819849773f35e24b31a3bbb253..f0a6a865548e51b9191a7f38c7ec976e3df3e88c 100644 (file)
@@ -109,17 +109,18 @@ void http_server_switch_ioloop(struct http_server *server)
 
 void http_server_shut_down(struct http_server *server)
 {
-       struct connection *_conn, *_next;
+       struct connection *_conn;
 
        server->shutting_down = TRUE;
 
-       for (_conn = server->conn_list->connections;
-               _conn != NULL; _conn = _next) {
+       _conn = server->conn_list->connections;
+       while (_conn != NULL) {
                struct http_server_connection *conn =
                        (struct http_server_connection *)_conn;
+               struct connection *_next = _conn->next;
 
-               _next = _conn->next;
                (void)http_server_connection_shut_down(conn);
+               _conn = _next;
        }
 }