]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
imap, pop3, lmtp: Close network sockets with net_disconnect().
authorTimo Sirainen <tss@iki.fi>
Thu, 17 Jun 2010 13:47:27 +0000 (14:47 +0100)
committerTimo Sirainen <tss@iki.fi>
Thu, 17 Jun 2010 13:47:27 +0000 (14:47 +0100)
--HG--
branch : HEAD

src/imap/imap-client.c
src/lmtp/client.c
src/pop3/pop3-client.c

index df8f08d7fec3c3a9cbc2b4247d7f0b052cfe837a..16d60c2d586d89b1eeac9481cb07ffd970182cd4 100644 (file)
@@ -211,12 +211,9 @@ void client_destroy(struct client *client, const char *reason)
        i_stream_destroy(&client->input);
        o_stream_destroy(&client->output);
 
-       if (close(client->fd_in) < 0)
-               i_error("close(client in) failed: %m");
-       if (client->fd_in != client->fd_out) {
-               if (close(client->fd_out) < 0)
-                       i_error("close(client out) failed: %m");
-       }
+       net_disconnect(client->fd_in);
+       if (client->fd_in != client->fd_out)
+               net_disconnect(client->fd_out);
 
        if (array_is_created(&client->search_saved_uidset))
                array_free(&client->search_saved_uidset);
index dc6f095f781b84fd4098bef6916a34be5f7707ec..df7e4567978f99d623ae182af4790e1426ecd26d 100644 (file)
@@ -260,12 +260,9 @@ void client_destroy(struct client *client, const char *prefix,
        i_stream_destroy(&client->input);
        o_stream_destroy(&client->output);
 
-       if (close(client->fd_in) < 0)
-               i_error("close(client in) failed: %m");
-       if (client->fd_in != client->fd_out) {
-               if (close(client->fd_out) < 0)
-                       i_error("close(client out) failed: %m");
-       }
+       net_disconnect(client->fd_in);
+       if (client->fd_in != client->fd_out)
+               net_disconnect(client->fd_out);
        client_state_reset(client);
        pool_unref(&client->state_pool);
        pool_unref(&client->pool);
index e0bbabae220a82c4e7eeb27d9db259b8c44189e6..6e2510394f4806e2c09594c6261dd9703ffafd09 100644 (file)
@@ -425,12 +425,9 @@ void client_destroy(struct client *client, const char *reason)
        i_stream_destroy(&client->input);
        o_stream_destroy(&client->output);
 
-       if (close(client->fd_in) < 0)
-               i_error("close(client in) failed: %m");
-       if (client->fd_in != client->fd_out) {
-               if (close(client->fd_out) < 0)
-                       i_error("close(client out) failed: %m");
-       }
+       net_disconnect(client->fd_in);
+       if (client->fd_in != client->fd_out)
+               net_disconnect(client->fd_out);
        mail_storage_service_user_free(&client->service_user);
        i_free(client);