]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
pop3c: Fix potential hangs with SSL
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 17 Nov 2025 13:32:05 +0000 (15:32 +0200)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Mon, 17 Nov 2025 13:34:42 +0000 (15:34 +0200)
io_add_istream() should be used when SSL iostreams.

src/lib-storage/index/pop3c/pop3c-client.c

index 9f494f2ea0c6119a8d6e9756097b25e50619673f..7608b2deedb2c76604d17e0d1e35b6b78c137503 100644 (file)
@@ -384,7 +384,8 @@ pop3c_client_get_sasl_plain_request(struct pop3c_client *client)
 static void pop3c_client_login_finished(struct pop3c_client *client)
 {
        io_remove(&client->io);
-       client->io = io_add(client->fd, IO_READ, pop3c_client_input, client);
+       client->io = io_add_istream(client->input,
+                                   pop3c_client_input, client);
 
        timeout_remove(&client->to);
        client->state = POP3C_CLIENT_STATE_DONE;
@@ -596,6 +597,11 @@ static int pop3c_client_ssl_init(struct pop3c_client *client)
                iostream_rawlog_create(client->set.rawlog_dir,
                                       &client->input, &client->output);
        }
+
+       i_assert(client->io != NULL);
+       io_remove(&client->io);
+       client->io = io_add_istream(client->input,
+                                   pop3c_client_prelogin_input, client);
        return 0;
 }