]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-master: stats_client_send_event() - Also flush conn.output and check for errors
authorMarco Bettini <marco.bettini@open-xchange.com>
Fri, 24 Mar 2023 14:04:00 +0000 (14:04 +0000)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Thu, 24 Aug 2023 08:15:26 +0000 (08:15 +0000)
src/lib-master/stats-client.c

index 692d0d6107d5b6b22d3bfb2fd7e1cc0bc65270b0..b7560005b063981c13cf254c31f1f6b1a208006d 100644 (file)
@@ -212,8 +212,12 @@ stats_client_send_event(struct stats_client *client, struct event *event,
        o_stream_nsend(client->conn.output, str_data(str), str_len(str));
 
        i_assert(recursion > 0);
-       if (--recursion == 0)
-               o_stream_uncork(client->conn.output);
+       if (--recursion == 0) {
+               if (o_stream_uncork_flush(client->conn.output) < 0) {
+                       e_error(client->conn.event, "write() failed: %s",
+                               o_stream_get_error(client->conn.output));
+               }
+       }
 }
 
 static void