]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
global: start relying on timeout_remove(NULL) being a no-op
authorJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Tue, 6 Jun 2017 09:33:23 +0000 (12:33 +0300)
committerJosef 'Jeff' Sipek <jeff.sipek@dovecot.fi>
Wed, 20 Sep 2017 09:29:06 +0000 (12:29 +0300)
Cleanup performed with the following semantic patch:

@@
expression E;
@@

- if (E != NULL) {
-  timeout_remove(&E);
- }
+ timeout_remove(&E);

93 files changed:
src/anvil/penalty.c
src/auth/auth-request-handler.c
src/auth/auth-request.c
src/auth/auth-worker-client.c
src/auth/auth-worker-server.c
src/auth/db-ldap.c
src/dict/dict-connection.c
src/dict/main.c
src/director/director-connection.c
src/director/director-test.c
src/director/director.c
src/director/main.c
src/doveadm/server-connection.c
src/imap-hibernate/imap-client.c
src/imap-login/imap-login-client.c
src/imap-urlauth/imap-urlauth-client.c
src/imap-urlauth/imap-urlauth-login.c
src/imap-urlauth/imap-urlauth-worker.c
src/imap/cmd-idle.c
src/imap/imap-client.c
src/imap/imap-notify.c
src/imap/imap-search.c
src/indexer/indexer.c
src/lib-auth/auth-master.c
src/lib-auth/auth-server-connection.c
src/lib-dict/dict-client.c
src/lib-dns/dns-lookup.c
src/lib-http/http-client-connection.c
src/lib-http/http-client-host.c
src/lib-http/http-client-peer.c
src/lib-http/http-client-queue.c
src/lib-http/http-client.c
src/lib-http/http-server-connection.c
src/lib-http/test-http-client-errors.c
src/lib-http/test-http-server-errors.c
src/lib-imap-client/imapc-client.c
src/lib-imap-client/imapc-connection.c
src/lib-imap-urlauth/imap-urlauth-connection.c
src/lib-ldap/ldap-connection.c
src/lib-master/anvil-client.c
src/lib-master/ipc-server.c
src/lib-master/master-auth.c
src/lib-master/master-login-auth.c
src/lib-master/master-service-haproxy.c
src/lib-master/master-service.c
src/lib-oauth2/oauth2.c
src/lib-program-client/program-client-local.c
src/lib-program-client/program-client-remote.c
src/lib-program-client/program-client.c
src/lib-smtp/lmtp-client.c
src/lib-sql/driver-cassandra.c
src/lib-sql/driver-pgsql.c
src/lib-sql/driver-sqlpool.c
src/lib-sql/sql-api.c
src/lib-storage/index/dbox-multi/mdbox-storage.c
src/lib-storage/index/imapc/imapc-mail-fetch.c
src/lib-storage/index/imapc/imapc-storage.c
src/lib-storage/index/mbox/mbox-storage.c
src/lib-storage/index/pop3c/pop3c-client.c
src/lib-storage/list/mailbox-list-index-notify.c
src/lib-storage/list/mailbox-list-index.c
src/lib-storage/mailbox-watch.c
src/lib-test/test-ostream.c
src/lib/connection.c
src/lib/istream-timeout.c
src/lib/log-throttle.c
src/lib/test-iostream-pump.c
src/lmtp/client.c
src/lmtp/commands.c
src/lmtp/lmtp-proxy.c
src/login-common/access-lookup.c
src/login-common/client-common-auth.c
src/login-common/client-common.c
src/login-common/login-proxy-state.c
src/login-common/login-proxy.c
src/login-common/main.c
src/master/main.c
src/master/service-monitor.c
src/master/service-process.c
src/master/service.c
src/plugins/last-login/last-login-plugin.c
src/plugins/mail-crypt/mail-crypt-plugin.c
src/plugins/quota-clone/quota-clone-plugin.c
src/plugins/stats/stats-plugin.c
src/plugins/zlib/zlib-plugin.c
src/pop3/pop3-client.c
src/replication/aggregator/replicator-connection.c
src/replication/replicator/dsync-client.c
src/replication/replicator/replicator-brain.c
src/stats/client.c
src/stats/mail-session.c
src/stats/stats-carbon.c
src/util/rawlog.c

index ce6a15587ca92fa9044ec4bdd2ba11c7a276bce1..73c1c7d31b20007c8d6f305c1c8b8a66592bee66 100644 (file)
@@ -78,8 +78,7 @@ void penalty_deinit(struct penalty **_penalty)
                penalty_rec_free(penalty, penalty->oldest);
        hash_table_destroy(&penalty->hash);
 
-       if (penalty->to != NULL)
-               timeout_remove(&penalty->to);
+       timeout_remove(&penalty->to);
        i_free(penalty);
 }
 
index 543c4bf28e9249962314d720be19518b9d835720..87c5bdefbd61f645ca286087fd10ee50adfe7de3 100644 (file)
@@ -832,8 +832,7 @@ void auth_request_handler_flush_failures(bool flush_all)
 
        count = aqueue_count(auth_failures);
        if (count == 0) {
-               if (to_auth_failures != NULL)
-                       timeout_remove(&to_auth_failures);
+               timeout_remove(&to_auth_failures);
                return;
        }
 
@@ -894,6 +893,5 @@ void auth_request_handler_deinit(void)
        array_free(&auth_failures_arr);
        aqueue_deinit(&auth_failures);
 
-       if (to_auth_failures != NULL)
-               timeout_remove(&to_auth_failures);
+       timeout_remove(&to_auth_failures);
 }
index 33e6a502746338a19cb9b66fb3d0c15007f384e0..6dc2705a23e840353d11a20d4878e1a36cd460c7 100644 (file)
@@ -175,8 +175,7 @@ void auth_request_success_continue(struct auth_policy_check_ctx *ctx)
        struct auth_stats *stats;
        i_assert(request->state == AUTH_REQUEST_STATE_MECH_CONTINUE);
 
-       if (request->to_penalty != NULL)
-               timeout_remove(&request->to_penalty);
+       timeout_remove(&request->to_penalty);
 
        if (request->failed || !request->passdb_success) {
                /* password was valid, but some other check failed. */
@@ -256,10 +255,8 @@ void auth_request_unref(struct auth_request **_request)
 
        if (request->dns_lookup_ctx != NULL)
                dns_lookup_abort(&request->dns_lookup_ctx->dns_lookup);
-       if (request->to_abort != NULL)
-               timeout_remove(&request->to_abort);
-       if (request->to_penalty != NULL)
-               timeout_remove(&request->to_penalty);
+       timeout_remove(&request->to_abort);
+       timeout_remove(&request->to_penalty);
 
        if (request->mech != NULL)
                request->mech->auth_free(request);
@@ -985,8 +982,7 @@ void auth_request_policy_penalty_finish(void *context)
 {
        struct auth_policy_check_ctx *ctx = context;
 
-       if (ctx->request->to_penalty != NULL)
-               timeout_remove(&ctx->request->to_penalty);
+       timeout_remove(&ctx->request->to_penalty);
 
        i_assert(ctx->request->state == AUTH_REQUEST_STATE_MECH_CONTINUE);
 
index 4fa775b7eb41794d3c6f8e9d7cec8dac75575d1d..4d07018a3d0b4a4f1a8becdaa0bd20773efbe14d 100644 (file)
@@ -603,8 +603,7 @@ auth_worker_handle_list(struct auth_worker_client *client,
        }
 
        io_remove(&ctx->client->io);
-       if (ctx->client->to_idle != NULL)
-               timeout_remove(&ctx->client->to_idle);
+       timeout_remove(&ctx->client->to_idle);
 
        o_stream_set_flush_callback(ctx->client->output,
                                    auth_worker_list_output, ctx);
@@ -787,8 +786,7 @@ void auth_worker_client_destroy(struct auth_worker_client **_client)
        i_stream_close(client->input);
        o_stream_close(client->output);
 
-       if (client->to_idle != NULL)
-               timeout_remove(&client->to_idle);
+       timeout_remove(&client->to_idle);
        io_remove(&client->io);
 
        net_disconnect(client->fd);
index be905cf4bb30c8821d9bff290a0781925e007974..753da46d85879be55817c2f9fc3df1eb0fe900b9 100644 (file)
@@ -243,8 +243,7 @@ static void auth_worker_destroy(struct auth_worker_connection **_conn,
        io_remove(&conn->io);
        i_stream_destroy(&conn->input);
        o_stream_destroy(&conn->output);
-       if (conn->to != NULL)
-               timeout_remove(&conn->to);
+       timeout_remove(&conn->to);
 
        if (close(conn->fd) < 0)
                i_error("close(auth worker) failed: %m");
@@ -479,8 +478,7 @@ void auth_worker_server_resume_input(struct auth_worker_connection *conn)
                conn->io = io_add(conn->fd, IO_READ, worker_input, conn);
        if (!conn->timeout_pending_resume) {
                conn->timeout_pending_resume = TRUE;
-               if (conn->to != NULL)
-                       timeout_remove(&conn->to);
+               timeout_remove(&conn->to);
                conn->to = timeout_add_short(0, worker_input_resume, conn);
        }
 }
index 5bf9fa4b56db74e396b97ac506c60a313cbd9525..6a705408c8a24000fd677a12ff6d5907b3af3541 100644 (file)
@@ -480,8 +480,7 @@ static int db_ldap_connect_finish(struct ldap_connection *conn, int ret)
                return -1;
        }
 
-       if (conn->to != NULL)
-               timeout_remove(&conn->to);
+       timeout_remove(&conn->to);
        conn->conn_state = LDAP_CONN_STATE_BOUND_DEFAULT;
        while (db_ldap_request_queue_next(conn))
                ;
@@ -1061,8 +1060,7 @@ static int db_ldap_bind_simple(struct ldap_connection *conn)
        conn->conn_state = LDAP_CONN_STATE_BINDING;
        conn->default_bind_msgid = msgid;
 
-       if (conn->to != NULL)
-               timeout_remove(&conn->to);
+       timeout_remove(&conn->to);
        conn->to = timeout_add(DB_LDAP_REQUEST_LOST_TIMEOUT_SECS*1000,
                               ldap_connection_timeout, conn);
        return 0;
@@ -1317,8 +1315,7 @@ static void db_ldap_conn_close(struct ldap_connection *conn)
        conn->delayed_connect = FALSE;
        conn->default_bind_msgid = -1;
 
-       if (conn->to != NULL)
-               timeout_remove(&conn->to);
+       timeout_remove(&conn->to);
 
        if (conn->pending_count != 0) {
                requests = array_idx(&conn->request_array, 0);
index e171adab1ea2f6dd0d14c8f90332ebd10075cdeb..934ea2d54d960639fbded8aafc0dc7262cfbd492 100644 (file)
@@ -258,8 +258,7 @@ bool dict_connection_unref(struct dict_connection *conn)
 
 static void dict_connection_unref_safe_callback(struct dict_connection *conn)
 {
-       if (conn->to_unref != NULL)
-               timeout_remove(&conn->to_unref);
+       timeout_remove(&conn->to_unref);
        (void)dict_connection_unref(conn);
 }
 
@@ -289,8 +288,7 @@ void dict_connection_destroy(struct dict_connection *conn)
        conn->destroyed = TRUE;
        DLLIST_REMOVE(&dict_connections, conn);
 
-       if (conn->to_input != NULL)
-               timeout_remove(&conn->to_input);
+       timeout_remove(&conn->to_input);
        io_remove(&conn->io);
        i_stream_close(conn->input);
        o_stream_close(conn->output);
index 536737e8cce15d586f8d3554832633859468a784..9df0a97c1d3337174c05e11bf8c7e56341c1ef52 100644 (file)
@@ -117,8 +117,7 @@ static void main_init(void)
 
 static void main_deinit(void)
 {
-       if (to_proctitle != NULL)
-               timeout_remove(&to_proctitle);
+       timeout_remove(&to_proctitle);
 
        dict_connections_destroy_all();
        dict_drivers_unregister_all();
index 40f1eb5dd6675e1448bdc1d1f8438d7a3f3596e8..9804ad4508f7aa79d3a330934c37dc8643a3d161 100644 (file)
@@ -2186,10 +2186,8 @@ void director_connection_deinit(struct director_connection **_conn,
                director_host_unref(conn->connect_request_to);
        if (conn->user_iter != NULL)
                director_iterate_users_deinit(&conn->user_iter);
-       if (conn->to_disconnect != NULL)
-               timeout_remove(&conn->to_disconnect);
-       if (conn->to_pong != NULL)
-               timeout_remove(&conn->to_pong);
+       timeout_remove(&conn->to_disconnect);
+       timeout_remove(&conn->to_pong);
        timeout_remove(&conn->to_ping);
        io_remove(&conn->io);
        i_stream_unref(&conn->input);
index fb9428bc84c072228de8430866e3d77bca6b51f0..4f60a6b8fbeea912d83326d069cbd76e64a77c1f 100644 (file)
@@ -152,15 +152,13 @@ static void client_username_check(struct imap_client *client)
        user->last_seen = ioloop_time;
        user->host->refcount++;
 
-       if (user->to != NULL)
-               timeout_remove(&user->to);
+       timeout_remove(&user->to);
 }
 
 static void user_free(struct user *user)
 {
        host_unref(&user->host);
-       if (user->to != NULL)
-               timeout_remove(&user->to);
+       timeout_remove(&user->to);
        hash_table_remove(users, user->username);
        i_free(user->username);
        i_free(user);
@@ -367,8 +365,7 @@ static void director_connection_destroy(struct director_connection **_conn)
 
        DLLIST_REMOVE(&director_connections, conn);
 
-       if (conn->to_delay != NULL)
-               timeout_remove(&conn->to_delay);
+       timeout_remove(&conn->to_delay);
 
        io_remove(&conn->in_io);
        i_stream_unref(&conn->in_input);
@@ -477,8 +474,7 @@ static void admin_disconnect(struct admin_connection **_conn)
        struct admin_connection *conn = *_conn;
 
        *_conn = NULL;
-       if (conn->to_random != NULL)
-               timeout_remove(&conn->to_random);
+       timeout_remove(&conn->to_random);
        i_stream_destroy(&conn->input);
        io_remove(&conn->io);
        net_disconnect(conn->fd);
index ebd86d0e7dfd4aab17943f9bd5a34b17c1005538..b7049c796e05e75c6b7979d4fcb5dfae089d73c3 100644 (file)
@@ -213,8 +213,7 @@ static bool director_wait_for_others(struct director *dir)
                (*hostp)->last_network_failure = 0;
                (*hostp)->last_protocol_failure = 0;
        }
-       if (dir->to_reconnect != NULL)
-               timeout_remove(&dir->to_reconnect);
+       timeout_remove(&dir->to_reconnect);
        dir->to_reconnect = timeout_add(DIRECTOR_QUICK_RECONNECT_TIMEOUT_MSECS,
                                        director_quick_reconnect_retry, dir);
        return TRUE;
@@ -281,8 +280,7 @@ void director_set_ring_handshaked(struct director *dir)
 {
        i_assert(!dir->ring_handshaked);
 
-       if (dir->to_handshake_warning != NULL)
-               timeout_remove(&dir->to_handshake_warning);
+       timeout_remove(&dir->to_handshake_warning);
        if (dir->ring_handshake_warning_sent) {
                i_warning("Directors have been connected, "
                          "continuing delayed requests");
@@ -321,8 +319,7 @@ void director_set_ring_synced(struct director *dir)
        i_assert((dir->left != NULL && dir->right != NULL) ||
                 (dir->left == NULL && dir->right == NULL));
 
-       if (dir->to_handshake_warning != NULL)
-               timeout_remove(&dir->to_handshake_warning);
+       timeout_remove(&dir->to_handshake_warning);
        if (dir->ring_handshake_warning_sent) {
                i_warning("Ring is synced, continuing delayed requests "
                          "(syncing took %d secs, hosts_hash=%u)",
@@ -334,8 +331,7 @@ void director_set_ring_synced(struct director *dir)
        host = dir->right == NULL ? NULL :
                director_connection_get_host(dir->right);
 
-       if (dir->to_reconnect != NULL)
-               timeout_remove(&dir->to_reconnect);
+       timeout_remove(&dir->to_reconnect);
        if (host != director_get_preferred_right_host(dir)) {
                /* try to reconnect to preferred host later */
                dir->to_reconnect =
@@ -347,8 +343,7 @@ void director_set_ring_synced(struct director *dir)
                director_connection_set_synced(dir->left, TRUE);
        if (dir->right != NULL)
                director_connection_set_synced(dir->right, TRUE);
-       if (dir->to_sync != NULL)
-               timeout_remove(&dir->to_sync);
+       timeout_remove(&dir->to_sync);
        dir->ring_synced = TRUE;
        dir->ring_last_sync_time = ioloop_time;
        mail_hosts_set_synced(dir->mail_hosts);
@@ -872,8 +867,7 @@ static void director_user_move_free(struct user *user)
        dir_debug("User %u move finished at state=%s", user->username_hash,
                  user_kill_state_names[kill_ctx->kill_state]);
 
-       if (kill_ctx->to_move != NULL)
-               timeout_remove(&kill_ctx->to_move);
+       timeout_remove(&kill_ctx->to_move);
        i_free(kill_ctx->socket_path);
        i_free(kill_ctx);
        user->kill_ctx = NULL;
@@ -1354,8 +1348,7 @@ static void director_user_freed(struct user *user)
                if (user->kill_ctx->callback_pending) {
                        /* kill_ctx is used as a callback parameter.
                           only remove the timeout and finish the free later. */
-                       if (user->kill_ctx->to_move != NULL)
-                               timeout_remove(&user->kill_ctx->to_move);
+                       timeout_remove(&user->kill_ctx->to_move);
                } else {
                        director_user_move_free(user);
                }
@@ -1403,18 +1396,12 @@ void director_deinit(struct director **_dir)
        mail_hosts_deinit(&dir->orig_config_hosts);
 
        ipc_client_deinit(&dir->ipc_proxy);
-       if (dir->to_reconnect != NULL)
-               timeout_remove(&dir->to_reconnect);
-       if (dir->to_handshake_warning != NULL)
-               timeout_remove(&dir->to_handshake_warning);
-       if (dir->to_request != NULL)
-               timeout_remove(&dir->to_request);
-       if (dir->to_sync != NULL)
-               timeout_remove(&dir->to_sync);
-       if (dir->to_remove_dirs != NULL)
-               timeout_remove(&dir->to_remove_dirs);
-       if (dir->to_callback != NULL)
-               timeout_remove(&dir->to_callback);
+       timeout_remove(&dir->to_reconnect);
+       timeout_remove(&dir->to_handshake_warning);
+       timeout_remove(&dir->to_request);
+       timeout_remove(&dir->to_sync);
+       timeout_remove(&dir->to_remove_dirs);
+       timeout_remove(&dir->to_callback);
        while (array_count(&dir->dir_hosts) > 0) {
                hostp = array_idx(&dir->dir_hosts, 0);
                host = *hostp;
index 121cc8fb79888ff170eca4d03536d981962f261a..853668bebf097596a300dde30895f3b3ebf3f704 100644 (file)
@@ -287,8 +287,7 @@ static void main_preinit(void)
 
 static void main_deinit(void)
 {
-       if (to_proctitle_refresh != NULL)
-               timeout_remove(&to_proctitle_refresh);
+       timeout_remove(&to_proctitle_refresh);
        if (notify_conn != NULL)
                notify_connection_deinit(&notify_conn);
        /* deinit doveadm connections before director, so it can clean up
index e3bbd58f752ac24fa66b1acbe627aa99480b0562..0ecf996c98e343d88eae472d1a43afd3dc1ed626 100644 (file)
@@ -305,8 +305,7 @@ static void server_connection_input(struct server_connection *conn)
 {
        const char *line;
 
-       if (conn->to_input != NULL)
-               timeout_remove(&conn->to_input);
+       timeout_remove(&conn->to_input);
 
        if (!conn->handshaked) {
                if ((line = i_stream_read_next_line(conn->input)) == NULL) {
@@ -551,8 +550,7 @@ void server_connection_destroy(struct server_connection **_conn)
        if (printing_conn == conn)
                print_connection_released();
 
-       if (conn->to_input != NULL)
-               timeout_remove(&conn->to_input);
+       timeout_remove(&conn->to_input);
        if (conn->input != NULL)
                i_stream_destroy(&conn->input);
        if (conn->output != NULL)
index f61f8666aae9160522c4e6650a9c19506997f3a5..53b28767b5a208427703829f270694c94ea95577 100644 (file)
@@ -430,8 +430,7 @@ static void imap_client_add_idle_keepalive_timeout(struct imap_client *client)
                                                 &client->state.remote_ip,
                                                 interval);
 
-       if (client->to_keepalive!= NULL)
-               timeout_remove(&client->to_keepalive);
+       timeout_remove(&client->to_keepalive);
        client->to_keepalive = timeout_add(interval, keepalive_timeout, client);
 }
 
@@ -587,8 +586,7 @@ static void imap_client_stop(struct imap_client *client)
        if (client->unhibernate_queued)
                priorityq_remove(unhibernate_queue, &client->item);
        io_remove(&client->io);
-       if (client->to_keepalive != NULL)
-               timeout_remove(&client->to_keepalive);
+       timeout_remove(&client->to_keepalive);
 
        array_foreach_modifiable(&client->notifys, notify) {
                io_remove(&notify->io);
@@ -715,7 +713,6 @@ void imap_clients_deinit(void)
                imap_client_io_activate_user(client);
                imap_client_destroy(&client, "Shutting down");
        }
-       if (to_unhibernate != NULL)
-               timeout_remove(&to_unhibernate);
+       timeout_remove(&to_unhibernate);
        priorityq_deinit(&unhibernate_queue);
 }
index f6e1d01febe8ef21ebfcbdeb40534bc6dcbe2b75..74f9305ca362346fc20294f8105de4c5be448d4d 100644 (file)
@@ -592,8 +592,7 @@ static void imap_client_input(struct client *client)
                           don't allow any commands */
                        client_notify_status(client, FALSE,
                                             AUTH_SERVER_WAITING_MSG);
-                       if (client->to_auth_waiting != NULL)
-                               timeout_remove(&client->to_auth_waiting);
+                       timeout_remove(&client->to_auth_waiting);
 
                        client->input_blocked = TRUE;
                        break;
index 5fbe3cff213dcde162cef0601e547b14a5a1d321..20850de2509b914782effc8aefcdb3e010755c6e 100644 (file)
@@ -332,8 +332,7 @@ void client_destroy(struct client *client, const char *reason)
        imap_urlauth_client_count--;
        DLLIST_REMOVE(&imap_urlauth_clients, client);
 
-       if (client->to_idle != NULL)
-               timeout_remove(&client->to_idle);
+       timeout_remove(&client->to_idle);
 
        client_worker_disconnect(client);
        
index fe0d4558828b795441099673d6ab983b920366db..7fa2c0a6698dd6893b5964f9d254435e078c1a17 100644 (file)
@@ -115,8 +115,7 @@ static void imap_urlauth_client_input(struct client *client)
        if (!auth_client_is_connected(auth_client)) {
                /* we're not currently connected to auth process -
                   don't allow any commands */
-               if (client->to_auth_waiting != NULL)
-                       timeout_remove(&client->to_auth_waiting);
+               timeout_remove(&client->to_auth_waiting);
                client->input_blocked = TRUE;
        } else {
                imap_urlauth_client_handle_input(client);
index b5f60e1aa074343403385297d8da8dfa2ffd6cfb..b24554016bc3b7c469c4d1fdb301e87d8b01517d 100644 (file)
@@ -240,8 +240,7 @@ static void client_destroy(struct client *client)
 
        io_remove(&client->io);
        io_remove(&client->ctrl_io);
-       if (client->to_idle != NULL)
-               timeout_remove(&client->to_idle);
+       timeout_remove(&client->to_idle);
 
        if (client->input != NULL)
                i_stream_destroy(&client->input);
index 092bc83b34044e750d6d1fc2922f6cdbd329fdd0..d7aba8e09d46d2425d62fef680e71409d4d7f904 100644 (file)
@@ -28,10 +28,8 @@ idle_finish(struct cmd_idle_context *ctx, bool done_ok, bool free_cmd)
 {
        struct client *client = ctx->client;
 
-       if (ctx->keepalive_to != NULL)
-               timeout_remove(&ctx->keepalive_to);
-       if (ctx->to_hibernate != NULL)
-               timeout_remove(&ctx->to_hibernate);
+       timeout_remove(&ctx->keepalive_to);
+       timeout_remove(&ctx->to_hibernate);
 
        if (ctx->sync_ctx != NULL) {
                /* we're here only in connection failure cases */
@@ -139,11 +137,9 @@ static bool idle_sync_now(struct mailbox *box, struct cmd_idle_context *ctx)
 {
        i_assert(ctx->sync_ctx == NULL);
 
-       if (ctx->to_hibernate != NULL) {
-               /* hibernation can't happen while sync is running.
-                  the timeout is added back afterwards. */
-               timeout_remove(&ctx->to_hibernate);
-       }
+       /* hibernation can't happen while sync is running.
+          the timeout is added back afterwards. */
+       timeout_remove(&ctx->to_hibernate);
 
        ctx->sync_pending = FALSE;
        ctx->sync_ctx = imap_sync_init(ctx->client, box, 0, 0);
@@ -175,8 +171,7 @@ static void idle_add_keepalive_timeout(struct cmd_idle_context *ctx)
                                                 ctx->client->user->remote_ip,
                                                 interval);
 
-       if (ctx->keepalive_to != NULL)
-               timeout_remove(&ctx->keepalive_to);
+       timeout_remove(&ctx->keepalive_to);
        ctx->keepalive_to = timeout_add(interval, keepalive_timeout, ctx);
 }
 
index 0efc4e9cc8dcf06ad7fd54a21feb964780d86a17..9e2fc68f9df181d6ebc3802aa6aa2aede17d786d 100644 (file)
@@ -433,10 +433,8 @@ static void client_default_destroy(struct client *client, const char *reason)
        if (client->free_parser != NULL)
                imap_parser_unref(&client->free_parser);
        io_remove(&client->io);
-       if (client->to_idle_output != NULL)
-               timeout_remove(&client->to_idle_output);
-       if (client->to_delayed_input != NULL)
-               timeout_remove(&client->to_delayed_input);
+       timeout_remove(&client->to_idle_output);
+       timeout_remove(&client->to_delayed_input);
        timeout_remove(&client->to_idle);
 
        /* i/ostreams are already closed at this stage, so fd can be closed */
@@ -498,8 +496,7 @@ void client_disconnect(struct client *client, const char *reason)
        i_stream_close(client->input);
        o_stream_close(client->output);
 
-       if (client->to_idle != NULL)
-               timeout_remove(&client->to_idle);
+       timeout_remove(&client->to_idle);
        client->to_idle = timeout_add(0, client_destroy_timeout, client);
 }
 
@@ -915,8 +912,7 @@ void client_command_free(struct client_command_context **_cmd)
        if (client->command_queue == NULL) {
                /* no commands left in the queue, we can clear the pool */
                p_clear(client->command_pool);
-               if (client->to_idle_output != NULL)
-                       timeout_remove(&client->to_idle_output);
+               timeout_remove(&client->to_idle_output);
        }
        imap_client_notify_command_freed(client);
        imap_refresh_proctitle();
@@ -1233,8 +1229,7 @@ void client_input(struct client *client)
        client->last_input = ioloop_time;
        timeout_reset(client->to_idle);
 
-       if (client->to_delayed_input != NULL)
-               timeout_remove(&client->to_delayed_input);
+       timeout_remove(&client->to_delayed_input);
 
        bytes = i_stream_read(client->input);
        if (bytes == -1) {
index dd0e5fd8aac58b7d20714376f7befc266582e2a6..306cc5bef0420a944d50ce4b8e8223859d0dcdb3 100644 (file)
@@ -501,8 +501,7 @@ void imap_notify_deinit(struct imap_notify_context **_ctx)
                if (notify_ns->notify != NULL)
                        mailbox_list_notify_deinit(&notify_ns->notify);
        }
-       if (ctx->to_watch != NULL)
-               timeout_remove(&ctx->to_watch);
+       timeout_remove(&ctx->to_watch);
        if (ctx->fetch_ctx != NULL)
                imap_fetch_free(&ctx->fetch_ctx);
        pool_unref(&ctx->pool);
index f895ca12e7146cff0f70085df08a84ae8483f819..0b608b844feb0cd676f553203ec98e703480f8f6 100644 (file)
@@ -631,8 +631,7 @@ static int imap_search_deinit(struct imap_search_context *ctx)
 
        (void)mailbox_transaction_commit(&ctx->trans);
 
-       if (ctx->to != NULL)
-               timeout_remove(&ctx->to);
+       timeout_remove(&ctx->to);
        if (array_is_created(&ctx->relevancy_scores))
                array_free(&ctx->relevancy_scores);
        array_free(&ctx->result);
index a30c16d4b11d8e3cc89b21d1f4dfc6e903577ef7..8de1cae912fe3ab97272fa43d7c0cebefde61d43 100644 (file)
@@ -61,8 +61,7 @@ static void queue_try_send_more(struct indexer_queue *queue)
        struct worker_connection *conn;
        struct indexer_request *request;
 
-       if (to_send_more != NULL)
-               timeout_remove(&to_send_more);
+       timeout_remove(&to_send_more);
 
        while ((request = indexer_queue_request_peek(queue)) != NULL) {
                conn = worker_pool_find_username_connection(worker_pool,
@@ -139,8 +138,7 @@ int main(int argc, char *argv[])
        indexer_clients_destroy_all();
        worker_pool_deinit(&worker_pool);
        indexer_queue_deinit(&queue);
-       if (to_send_more != NULL)
-               timeout_remove(&to_send_more);
+       timeout_remove(&to_send_more);
 
        master_service_deinit(&master_service);
         return 0;
index 0b611c317458a8dbb54c00b20dc7cf62d2e97068..85b0790e34b44a956a9c9559152a7486590c959c 100644 (file)
@@ -82,8 +82,7 @@ auth_master_init(const char *auth_socket_path, enum auth_master_flags flags)
 
 static void auth_connection_close(struct auth_master_connection *conn)
 {
-       if (conn->to != NULL)
-               timeout_remove(&conn->to);
+       timeout_remove(&conn->to);
        if (conn->fd != -1) {
                if (close(conn->fd) < 0)
                        i_error("close(%s) failed: %m", conn->auth_socket_path);
@@ -338,8 +337,7 @@ static void auth_master_set_io(struct auth_master_connection *conn)
        if (conn->ioloop != NULL)
                return;
 
-       if (conn->to != NULL)
-               timeout_remove(&conn->to);
+       timeout_remove(&conn->to);
 
        conn->prev_ioloop = current_ioloop;
        conn->ioloop = io_loop_create();
index 71d2df1550f7524c549dc6a6a4f1042081844c41..d3ca908890034bee4b9b3a4b8318e6c827a2a64b 100644 (file)
@@ -120,8 +120,7 @@ static int auth_server_input_done(struct auth_server_connection *conn)
                return -1;
        }
 
-       if (conn->to != NULL)
-               timeout_remove(&conn->to);
+       timeout_remove(&conn->to);
 
        conn->handshake_received = TRUE;
        if (conn->client->connect_notify_callback != NULL) {
@@ -357,8 +356,7 @@ void auth_server_connection_disconnect(struct auth_server_connection *conn,
        conn->cookie = NULL;
        array_clear(&conn->available_auth_mechs);
 
-       if (conn->to != NULL)
-               timeout_remove(&conn->to);
+       timeout_remove(&conn->to);
        io_remove(&conn->io);
        if (conn->fd != -1) {
                i_stream_destroy(&conn->input);
@@ -425,8 +423,7 @@ int auth_server_connection_connect(struct auth_server_connection *conn)
        i_assert(conn->fd == -1);
 
        conn->last_connect = ioloop_time;
-       if (conn->to != NULL)
-               timeout_remove(&conn->to);
+       timeout_remove(&conn->to);
 
        /* max. 1 second wait here. */
        fd = net_connect_unix_with_retries(conn->client->auth_socket_path,
index 158fed13639b5d857f7760deb855ef1e5d06a860..e425d0406cbe7423443b373191bf659e331264a8 100644 (file)
@@ -314,8 +314,7 @@ client_dict_cmd_send(struct client_dict *dict, struct client_dict_cmd **_cmd,
 
        /* we're no longer idling. even with no_replies=TRUE we're going to
           wait for COMMIT/ROLLBACK. */
-       if (dict->to_idle != NULL)
-               timeout_remove(&dict->to_idle);
+       timeout_remove(&dict->to_idle);
 
        if (client_dict_connect(dict, &error) < 0) {
                retry = FALSE;
@@ -441,14 +440,12 @@ static void client_dict_add_timeout(struct client_dict *dict)
        } else if (client_dict_is_finished(dict)) {
                dict->to_idle = timeout_add(dict->idle_msecs,
                                            client_dict_timeout, dict);
-               if (dict->to_requests != NULL)
-                       timeout_remove(&dict->to_requests);
+               timeout_remove(&dict->to_requests);
        } else if (dict->transactions == NULL &&
                   !client_dict_have_nonbackground_cmds(dict)) {
                /* we had non-background commands, but now we're back to
                   having only background commands. remove timeouts. */
-               if (dict->to_requests != NULL)
-                       timeout_remove(&dict->to_requests);
+               timeout_remove(&dict->to_requests);
        }
 }
 
@@ -633,10 +630,8 @@ static void client_dict_disconnect(struct client_dict *dict, const char *reason)
                        ctx->error = i_strdup(reason);
        }
 
-       if (dict->to_idle != NULL)
-               timeout_remove(&dict->to_idle);
-       if (dict->to_requests != NULL)
-               timeout_remove(&dict->to_requests);
+       timeout_remove(&dict->to_idle);
+       timeout_remove(&dict->to_requests);
        connection_disconnect(&dict->conn.conn);
 }
 
index 3866dfa1f5f5636345748499d545529cb6062795..c67a20e1f46328f263105e861ad95c5648f24375 100644 (file)
@@ -59,8 +59,7 @@ static void dns_client_disconnect(struct dns_client *client, const char *error)
        struct dns_lookup *lookup, *next;
        struct dns_lookup_result result;
 
-       if (client->to_idle != NULL)
-               timeout_remove(&client->to_idle);
+       timeout_remove(&client->to_idle);
        io_remove(&client->io);
        if (client->input != NULL)
                i_stream_destroy(&client->input);
@@ -239,8 +238,7 @@ static void dns_lookup_free(struct dns_lookup **_lookup)
        *_lookup = NULL;
 
        DLLIST2_REMOVE(&client->head, &client->tail, lookup);
-       if (lookup->to != NULL)
-               timeout_remove(&lookup->to);
+       timeout_remove(&lookup->to);
        i_free(lookup->name);
        i_free(lookup->ips);
        if (client->deinit_client_at_free)
@@ -365,8 +363,7 @@ dns_client_lookup_common(struct dns_client *client,
        if (gettimeofday(&lookup->start_time, NULL) < 0)
                i_fatal("gettimeofday() failed: %m");
 
-       if (client->to_idle != NULL)
-               timeout_remove(&client->to_idle);
+       timeout_remove(&client->to_idle);
        DLLIST2_APPEND(&client->head, &client->tail, lookup);
        *lookup_r = lookup;
        return 0;
index 814de2b40f5114d24b6938436d6b045ec88093b4..ab0c5c1e8c24d34ae08171705037f933a62ac657 100644 (file)
@@ -443,8 +443,7 @@ void http_client_connection_reset_request_timeout(
 void http_client_connection_stop_request_timeout(
        struct http_client_connection *conn)
 {
-       if (conn->to_requests != NULL)
-               timeout_remove(&conn->to_requests);
+       timeout_remove(&conn->to_requests);
 }
 
 static void
@@ -457,8 +456,7 @@ http_client_connection_continue_timeout(struct http_client_connection *conn)
 
        i_assert(conn->pending_request == NULL);
 
-       if (conn->to_response != NULL)
-               timeout_remove(&conn->to_response);
+       timeout_remove(&conn->to_response);
        conn->peer->no_payload_sync = TRUE;
 
        http_client_connection_debug(conn, 
@@ -499,8 +497,7 @@ int http_client_connection_next_request(struct http_client_connection *conn)
 
        i_assert(req->state == HTTP_REQUEST_STATE_QUEUED);
 
-       if (conn->to_idle != NULL)
-               timeout_remove(&conn->to_idle);
+       timeout_remove(&conn->to_idle);
 
        req->payload_sync_continue = FALSE;
        if (conn->peer->no_payload_sync)
@@ -873,8 +870,7 @@ static void http_client_connection_input(struct connection *_conn)
                req->response_time = ioloop_timeval;
 
                /* Got some response; cancel response timeout */
-               if (conn->to_response != NULL)
-                       timeout_remove(&conn->to_response);
+               timeout_remove(&conn->to_response);
 
                /* RFC 7231, Section 6.2:
 
@@ -1164,8 +1160,7 @@ http_client_connection_ready(struct http_client_connection *conn)
        /* connected */
        conn->connected = TRUE;
        conn->last_ioloop = current_ioloop;
-       if (conn->to_connect != NULL)
-               timeout_remove(&conn->to_connect);
+       timeout_remove(&conn->to_connect);
 
        /* indicate connection success */
        conn->connect_succeeded = TRUE;
@@ -1547,16 +1542,11 @@ http_client_connection_disconnect(struct http_client_connection *conn)
                connection_disconnect(&conn->conn);
 
        io_remove(&conn->io_req_payload);
-       if (conn->to_requests != NULL)
-               timeout_remove(&conn->to_requests);
-       if (conn->to_connect != NULL)
-               timeout_remove(&conn->to_connect);
-       if (conn->to_input != NULL)
-               timeout_remove(&conn->to_input);
-       if (conn->to_idle != NULL)
-               timeout_remove(&conn->to_idle);
-       if (conn->to_response != NULL)
-               timeout_remove(&conn->to_response);
+       timeout_remove(&conn->to_requests);
+       timeout_remove(&conn->to_connect);
+       timeout_remove(&conn->to_input);
+       timeout_remove(&conn->to_idle);
+       timeout_remove(&conn->to_response);
 
        /* remove this connection from the list */
        conn_arr = &peer->conns;
index ebe4cd25ba6c20ffb676e4708f15b56ae0c49874..d3c3a63e4e392eda6e1c3921329d731688e95c58 100644 (file)
@@ -255,8 +255,7 @@ void http_client_host_submit_request(struct http_client_host *host,
        http_client_queue_submit_request(queue, req);
 
        /* cancel host idle timeout */
-       if (host->to_idle != NULL)
-               timeout_remove(&host->to_idle);
+       timeout_remove(&host->to_idle);
 
        if (host->unix_local) {
                http_client_queue_connection_setup(queue);
index 306e4a83180f7434a219924db7301e2fc028a551..1de86455c12e31bb7a6a9d04ef40f1ce6f10e5d0 100644 (file)
@@ -200,8 +200,7 @@ http_client_peer_reset_backoff_timer(struct http_client_peer *peer)
 {
        peer->backoff_time_msecs = 0;
 
-       if (peer->to_backoff != NULL)
-               timeout_remove(&peer->to_backoff);
+       timeout_remove(&peer->to_backoff);
 }
 
 static void
index ebd7c8398e796a7b2c4ef0fa3fb0b68245f818cc..8e6883f3b0987dc2f040c9d771c9e8282b302f4a 100644 (file)
@@ -274,8 +274,7 @@ http_client_queue_soft_connect_timeout(struct http_client_queue *queue)
 
        i_assert(queue->addr.type != HTTP_CLIENT_PEER_ADDR_UNIX);
 
-       if (queue->to_connect != NULL)
-               timeout_remove(&queue->to_connect);
+       timeout_remove(&queue->to_connect);
 
        if (http_client_queue_is_last_connect_ip(queue)) {
                /* no more IPs to try */
@@ -316,8 +315,7 @@ http_client_queue_connection_attempt(struct http_client_queue *queue)
        /* check whether host IPs are still up-to-date */
        if ((ret=http_client_host_refresh(host)) < 0) {
                /* performing asynchronous lookup */
-               if (queue->to_connect != NULL)
-                       timeout_remove(&queue->to_connect);
+               timeout_remove(&queue->to_connect);
                return NULL;
        }
        if (ret > 0) {
@@ -468,8 +466,7 @@ http_client_queue_connection_success(struct http_client_queue *queue,
        queue->connect_attempts = 0;
 
        /* stop soft connect time-out */
-       if (queue->to_connect != NULL)
-               timeout_remove(&queue->to_connect);
+       timeout_remove(&queue->to_connect);
 
        /* drop all other attempts to the hport. note that we get here whenever
           a connection is successfully created, so pending_peers array
@@ -560,8 +557,7 @@ http_client_queue_connection_failure(struct http_client_queue *queue,
        /* one of the connections failed. if we're not using soft timeouts,
           we need to try to connect to the next IP. if we are using soft
           timeouts, we've already tried all of the IPs by now. */
-       if (queue->to_connect != NULL)
-               timeout_remove(&queue->to_connect);
+       timeout_remove(&queue->to_connect);
 
        if (queue->addr.type == HTTP_CLIENT_PEER_ADDR_UNIX) {
                http_client_queue_fail(queue,
@@ -766,8 +762,7 @@ http_client_queue_set_request_timer(struct http_client_queue *queue,
        const struct timeval *time)
 {
        i_assert(time->tv_sec > 0);
-       if (queue->to_request != NULL)
-               timeout_remove(&queue->to_request);     
+       timeout_remove(&queue->to_request);     
 
        if (queue->client->set.debug) {
                http_client_queue_debug(queue,
@@ -890,8 +885,7 @@ http_client_queue_set_delay_timer(struct http_client_queue *queue,
        msecs = (usecs + 999) / 1000;
 
        /* set timer */
-       if (queue->to_delayed != NULL)
-               timeout_remove(&queue->to_delayed);     
+       timeout_remove(&queue->to_delayed);     
        queue->to_delayed = timeout_add
                (msecs, http_client_queue_delay_timeout, queue);
 }
index 6f36c4c5d36e50ac155ca8687af75675a11d4496..ee1628b171f2a0c387dea1edcd4c63a00418ced6 100644 (file)
@@ -196,8 +196,7 @@ void http_client_deinit(struct http_client **_client)
        hash_table_destroy(&client->hosts);
 
        array_free(&client->delayed_failing_requests);
-       if (client->to_failing_requests != NULL)
-               timeout_remove(&client->to_failing_requests);
+       timeout_remove(&client->to_failing_requests);
 
        connection_list_deinit(&client->conn_list);
 
index c471b096bdb7a09416b004acb54e53c085481f02..c17df3c205a968328a382020f00482aadfc1a73e 100644 (file)
@@ -131,8 +131,7 @@ http_server_connection_idle_timeout(struct http_server_connection *conn)
 static void
 http_server_connection_timeout_stop(struct http_server_connection *conn)
 {
-       if (conn->to_idle != NULL)
-               timeout_remove(&conn->to_idle);
+       timeout_remove(&conn->to_idle);
 }
 
 static void
@@ -1164,8 +1163,7 @@ http_server_connection_disconnect(struct http_server_connection *conn,
                req = req_next;
        }
 
-       if (conn->to_input != NULL)
-               timeout_remove(&conn->to_input);
+       timeout_remove(&conn->to_input);
 
        http_server_connection_timeout_stop(conn);
        io_remove(&conn->io_resp_payload);
index 15bc4f78b5beb747166f41915ebc7534d2424383..0c0bfc10f6af47e41440ec8059026c27b5ef24a0 100644 (file)
@@ -386,8 +386,7 @@ test_client_connection_refused_response(
        struct _connection_refused *ctx)
 {
        test_assert(ctx->to == NULL);
-       if (ctx->to != NULL)
-               timeout_remove(&ctx->to);
+       timeout_remove(&ctx->to);
 
        if (debug)
                i_debug("RESPONSE: %u %s", resp->status, resp->reason);
@@ -497,8 +496,7 @@ test_client_connection_lost_prematurely_response(
        struct _connection_lost_prematurely *ctx)
 {
        test_assert(ctx->to == NULL);
-       if (ctx->to != NULL)
-               timeout_remove(&ctx->to);
+       timeout_remove(&ctx->to);
 
        if (debug)
                i_debug("RESPONSE: %u %s", resp->status, resp->reason);
@@ -1675,8 +1673,7 @@ static void
 test_client_request_timed_out2_timeout(
        struct _request_timed_out2_ctx *ctx)
 {
-       if (ctx->to != NULL)
-               timeout_remove(&ctx->to);
+       timeout_remove(&ctx->to);
        i_debug("TIMEOUT");
 }
 
@@ -1696,8 +1693,7 @@ test_client_request_timed_out2_response(
                if (ctx->to != NULL && ctx->max_parallel_connections <= 1)
                        timeout_reset(ctx->to);
        } else {
-               if (ctx->to != NULL)
-                       timeout_remove(&ctx->to);
+               timeout_remove(&ctx->to);
                i_free(ctx);
                io_loop_stop(ioloop);
        }
index 1fb4d6f3ffc44a9dc37262b916b146ef8fb81dd4..81db670d4d8c2a318dd9e40cca787508c53c5a21 100644 (file)
@@ -119,8 +119,7 @@ static void
 test_server_slow_request_destroyed(struct _slow_request *ctx)
 {
        test_assert(ctx->serviced);
-       if (ctx->to_delay != NULL)
-               timeout_remove(&ctx->to_delay);
+       timeout_remove(&ctx->to_delay);
        i_free(ctx);
        io_loop_stop(ioloop);
 }
index 0918b66afb37cbf0927375e21e62e9b271872168..96f51b03053d22cc2f7b42563c84b0640c9ca656 100644 (file)
@@ -442,8 +442,7 @@ void imapc_client_mailbox_close(struct imapc_client_mailbox **_box)
        }
 
        imapc_msgmap_deinit(&box->msgmap);
-       if (box->to_send_idle != NULL)
-               timeout_remove(&box->to_send_idle);
+       timeout_remove(&box->to_send_idle);
        i_free(box);
 }
 
index ba503527c694aa50aaed8a348053059d69506b57..dde95b66bc1fe20f1ecd5467186fa6ba17fcca9b 100644 (file)
@@ -426,8 +426,7 @@ void imapc_connection_disconnect_full(struct imapc_connection *conn,
                                      bool reconnecting)
 {
        /* timeout may be set also in disconnected state */
-       if (conn->to != NULL)
-               timeout_remove(&conn->to);
+       timeout_remove(&conn->to);
        conn->reconnecting = reconnecting;
 
        if (conn->state == IMAPC_CONNECTION_STATE_DISCONNECTED)
@@ -440,12 +439,9 @@ void imapc_connection_disconnect_full(struct imapc_connection *conn,
                dns_lookup_abort(&conn->dns_lookup);
        imapc_connection_lfiles_free(conn);
        imapc_connection_literal_reset(&conn->literal);
-       if (conn->to_output != NULL)
-               timeout_remove(&conn->to_output);
-       if (conn->to_throttle != NULL)
-               timeout_remove(&conn->to_throttle);
-       if (conn->to_throttle_shrink != NULL)
-               timeout_remove(&conn->to_throttle_shrink);
+       timeout_remove(&conn->to_output);
+       timeout_remove(&conn->to_throttle);
+       timeout_remove(&conn->to_throttle_shrink);
        if (conn->parser != NULL)
                imap_parser_unref(&conn->parser);
        io_remove(&conn->io);
@@ -1320,8 +1316,7 @@ static void
 imapc_connection_throttle(struct imapc_connection *conn,
                          const struct imapc_command_reply *reply)
 {
-       if (conn->to_throttle != NULL)
-               timeout_remove(&conn->to_throttle);
+       timeout_remove(&conn->to_throttle);
 
        /* If GMail returns [THROTTLED], start slowing down commands.
           Unfortunately this isn't a nice resp-text-code, but just
@@ -2084,8 +2079,7 @@ static void imapc_connection_set_selecting(struct imapc_client_mailbox *box)
 
 static bool imapc_connection_is_throttled(struct imapc_connection *conn)
 {
-       if (conn->to_throttle != NULL)
-               timeout_remove(&conn->to_throttle);
+       timeout_remove(&conn->to_throttle);
 
        if (conn->throttle_msecs == 0) {
                /* we haven't received [THROTTLED] recently */
@@ -2168,8 +2162,7 @@ static void imapc_command_send_more(struct imapc_connection *conn)
           (pre-login has its own timeout) */
        if ((cmd->flags & IMAPC_COMMAND_FLAG_LOGOUT) != 0) {
                /* LOGOUT has a shorter timeout */
-               if (conn->to != NULL)
-                       timeout_remove(&conn->to);
+               timeout_remove(&conn->to);
                conn->to = timeout_add(IMAPC_LOGOUT_TIMEOUT_MSECS,
                                       imapc_command_timeout, conn);
        } else if (conn->to == NULL) {
index 1047a5e25de1669b9c27a2e36be06a475e2358c7..9af54a4cf4272de4875867248a36911d9648f223 100644 (file)
@@ -145,8 +145,7 @@ void imap_urlauth_connection_deinit(struct imap_urlauth_connection **_conn)
 static void
 imap_urlauth_stop_response_timeout(struct imap_urlauth_connection *conn)
 {
-       if (conn->to_response != NULL)
-               timeout_remove(&conn->to_response);
+       timeout_remove(&conn->to_response);
 }
 
 static void
@@ -218,8 +217,7 @@ imap_urlauth_connection_send_request(struct imap_urlauth_connection *conn)
             conn->state == IMAP_URLAUTH_STATE_READY)) {
                if (conn->user->mail_debug)
                        i_debug("imap-urlauth: No more requests pending; scheduling disconnect");
-               if (conn->to_idle != NULL)
-                       timeout_remove(&conn->to_idle);
+               timeout_remove(&conn->to_idle);
                if (conn->idle_timeout_msecs > 0) {
                        conn->to_idle = timeout_add(conn->idle_timeout_msecs,
                                imap_urlauth_connection_idle_disconnect, conn);
@@ -295,8 +293,7 @@ imap_urlauth_request_new(struct imap_urlauth_connection *conn,
 
        DLLIST2_APPEND(&target->requests_head, &target->requests_tail, urlreq);
 
-       if (conn->to_idle != NULL)
-               timeout_remove(&conn->to_idle);
+       timeout_remove(&conn->to_idle);
        
        if (conn->user->mail_debug) {
                i_debug("imap-urlauth: Added request for URL `%s' from user `%s'",
@@ -911,8 +908,7 @@ imap_urlauth_connection_do_connect(struct imap_urlauth_connection *conn)
                return -1;
        }
 
-       if (conn->to_reconnect != NULL)
-               timeout_remove(&conn->to_reconnect);
+       timeout_remove(&conn->to_reconnect);
 
        conn->fd = fd;
        conn->input = i_stream_create_fd(fd, (size_t)-1);
@@ -979,10 +975,8 @@ static void imap_urlauth_connection_disconnect
 
        if (conn->literal_buf != NULL)
                buffer_free(&conn->literal_buf);
-       if (conn->to_reconnect != NULL)
-               timeout_remove(&conn->to_reconnect);
-       if (conn->to_idle != NULL)
-               timeout_remove(&conn->to_idle);
+       timeout_remove(&conn->to_reconnect);
+       timeout_remove(&conn->to_idle);
        imap_urlauth_stop_response_timeout(conn);
 }
 
@@ -998,8 +992,7 @@ imap_urlauth_connection_do_reconnect(struct imap_urlauth_connection *conn)
        if (ioloop_time - conn->last_reconnect < IMAP_URLAUTH_RECONNECT_MIN_SECS) {
                if (conn->user->mail_debug)
                        i_debug("imap-urlauth: Scheduling reconnect");
-               if (conn->to_reconnect != NULL)
-                       timeout_remove(&conn->to_reconnect);
+               timeout_remove(&conn->to_reconnect);
                conn->to_reconnect =
                        timeout_add(IMAP_URLAUTH_RECONNECT_MIN_SECS*1000,
                                imap_urlauth_connection_do_reconnect, conn);
index e9991a92b9b75691f24d651a9baaaef12f226f18..546777849fa2d2a5ca7f5f4021136e626d70c563 100644 (file)
@@ -32,8 +32,7 @@ void ldap_connection_deinit(struct ldap_connection **_conn)
                struct ldap_op_queue_entry *const *reqp =
                        array_idx(&(conn->request_array),
                                  aqueue_idx(conn->request_queue, i));
-               if ((*reqp)->to_abort != NULL)
-                       timeout_remove(&(*reqp)->to_abort);
+               timeout_remove(&(*reqp)->to_abort);
        }
        pool_unref(&conn->pool);
 }
@@ -300,8 +299,7 @@ void ldap_connection_request_destroy(struct ldap_op_queue_entry **_req)
 
        *_req = NULL;
 
-       if (req->to_abort != NULL)
-               timeout_remove(&req->to_abort);
+       timeout_remove(&req->to_abort);
        pool_unref(&req->pool);
 }
 
@@ -413,8 +411,7 @@ void ldap_connection_abort_request(struct ldap_op_queue_entry *req)
        struct ldap_result res;
 
        /* too bad */
-       if (req->to_abort != NULL)
-               timeout_remove(&req->to_abort);
+       timeout_remove(&req->to_abort);
        if (req->msgid > -1)
                ldap_abandon_ext(req->conn->conn, req->msgid, NULL, NULL);
 
@@ -451,8 +448,7 @@ void ldap_connection_abort_all_requests(struct ldap_connection *conn)
                struct ldap_op_queue_entry **reqp =
                        array_idx_modifiable(&(conn->request_array),
                aqueue_idx(conn->request_queue, i));
-               if ((*reqp)->to_abort != NULL)
-                       timeout_remove(&(*reqp)->to_abort);
+               timeout_remove(&(*reqp)->to_abort);
                if ((*reqp)->result_callback != NULL)
                        (*reqp)->result_callback(&res, (*reqp)->result_callback_ctx);
                ldap_connection_request_destroy(reqp);
index 5d34030b136b5d5fe0e21d6c35f545846902e6aa..2874a8b91042f587025df09c0a60a18901a1c41a 100644 (file)
@@ -144,8 +144,7 @@ int anvil_client_connect(struct anvil_client *client, bool retry)
                return -1;
        }
 
-       if (client->to_reconnect != NULL)
-               timeout_remove(&client->to_reconnect);
+       timeout_remove(&client->to_reconnect);
 
        client->fd = fd;
        client->input = i_stream_create_fd(fd, ANVIL_INBUF_SIZE);
@@ -173,8 +172,7 @@ static void anvil_client_cancel_queries(struct anvil_client *client)
                i_free(query);
                aqueue_delete_tail(client->queries);
        }
-       if (client->to_query != NULL)
-               timeout_remove(&client->to_query);
+       timeout_remove(&client->to_query);
 }
 
 static void anvil_client_disconnect(struct anvil_client *client)
@@ -187,8 +185,7 @@ static void anvil_client_disconnect(struct anvil_client *client)
                net_disconnect(client->fd);
                client->fd = -1;
        }
-       if (client->to_reconnect != NULL)
-               timeout_remove(&client->to_reconnect);
+       timeout_remove(&client->to_reconnect);
 }
 
 static void anvil_client_timeout(struct anvil_client *client)
index 86619188f5473e5d390b6be4313bdc5d7d5f1d6d..0ccc76a244fddf9b7e9519849a267bdc0dfe3aa1 100644 (file)
@@ -97,8 +97,7 @@ static void ipc_server_connect(struct ipc_server *server)
 {
        i_assert(server->fd == -1);
 
-       if (server->to != NULL)
-               timeout_remove(&server->to);
+       timeout_remove(&server->to);
 
        server->fd = net_connect_unix(server->path);
        if (server->fd == -1) {
@@ -154,8 +153,7 @@ void ipc_server_deinit(struct ipc_server **_server)
        i_assert(server->ipc_cmd_refcount == 0);
 
        ipc_server_disconnect(server);
-       if (server->to != NULL)
-               timeout_remove(&server->to);
+       timeout_remove(&server->to);
        i_free(server->name);
        i_free(server->path);
        i_free(server);
index de476ab7155e27e7bada8816344cbbe178fde59b..59243a3d2fc61faa937fcc2feb3bef2bab6ee463 100644 (file)
@@ -69,8 +69,7 @@ master_auth_connection_deinit(struct master_auth_connection **_conn)
        if (conn->callback != NULL)
                conn->callback(NULL, conn->context);
 
-       if (conn->to != NULL)
-               timeout_remove(&conn->to);
+       timeout_remove(&conn->to);
        io_remove(&conn->io);
        if (conn->fd != -1) {
                if (close(conn->fd) < 0)
index 5f6dfd57b823a8701bb30c9bfd35ed79c7d452f0..ad6a14f1ba61d7465b1e2c7ca716977857b42ccf 100644 (file)
@@ -105,8 +105,7 @@ void master_login_auth_disconnect(struct master_login_auth *auth)
        }
        hash_table_clear(auth->requests, FALSE);
 
-       if (auth->to != NULL)
-               timeout_remove(&auth->to);
+       timeout_remove(&auth->to);
        io_remove(&auth->io);
        if (auth->fd != -1) {
                if (auth->input != NULL)
index 4438b5925d05bef04c01c88ea8c6d6972b8ade42..73d7fc2af371773b7fd950323909b93374efb521 100644 (file)
@@ -77,8 +77,7 @@ master_service_haproxy_conn_free(struct master_service_haproxy_conn *hpconn)
        DLLIST_REMOVE(&service->haproxy_conns, hpconn);
 
        io_remove(&hpconn->io);
-       if (hpconn->to != NULL)
-               timeout_remove(&hpconn->to);
+       timeout_remove(&hpconn->to);
        i_free(hpconn);
 }
 
index 6e66917abd305378f18e5e486aea3992a3e9620d..4c669074e280ef1d8b102b75b0c91a4a3ac95e33 100644 (file)
@@ -893,8 +893,7 @@ void master_service_client_connection_destroyed(struct master_service *service)
 static void master_service_set_login_state(struct master_service *service,
                                           enum master_login_state state)
 {
-       if (service->to_overflow_state != NULL)
-               timeout_remove(&service->to_overflow_state);
+       timeout_remove(&service->to_overflow_state);
 
        switch (state) {
        case MASTER_LOGIN_STATE_NONFULL:
@@ -953,12 +952,9 @@ void master_service_deinit(struct master_service **_service)
        master_service_ssl_ctx_deinit(service);
 
        master_service_close_config_fd(service);
-       if (service->to_die != NULL)
-               timeout_remove(&service->to_die);
-       if (service->to_overflow_state != NULL)
-               timeout_remove(&service->to_overflow_state);
-       if (service->to_status != NULL)
-               timeout_remove(&service->to_status);
+       timeout_remove(&service->to_die);
+       timeout_remove(&service->to_overflow_state);
+       timeout_remove(&service->to_status);
        io_remove(&service->io_status_error);
        io_remove(&service->io_status_write);
        if (array_is_created(&service->config_overrides))
@@ -1120,8 +1116,7 @@ master_status_send(struct master_service *service, bool important_update)
 {
        ssize_t ret;
 
-       if (service->to_status != NULL)
-               timeout_remove(&service->to_status);
+       timeout_remove(&service->to_status);
 
        ret = write(MASTER_STATUS_FD, &service->master_status,
                    sizeof(service->master_status));
index a694dbf7ab0152cad04cfc3eaa4fddc9a7fa1f19..760f8a7c761ea305a2ed46d5122e3f20b7cf528a 100644 (file)
@@ -79,8 +79,7 @@ oauth2_request_abort(struct oauth2_request **_req)
 void
 oauth2_request_free_internal(struct oauth2_request *req)
 {
-       if (req->to_delayed_error != NULL)
-               timeout_remove(&req->to_delayed_error);
+       timeout_remove(&req->to_delayed_error);
        pool_unref(&req->pool);
 }
 
index f86557270bcc64cf2ed380b5ba145596ad1653dc..29925a64bcf0d439a52ff0845240185bb901e040 100644 (file)
@@ -296,8 +296,7 @@ int program_client_local_close_output(struct program_client *pclient)
 static
 void program_client_local_exited(struct program_client_local *plclient)
 {
-       if (plclient->to_kill != NULL)
-               timeout_remove(&plclient->to_kill);
+       timeout_remove(&plclient->to_kill);
        if (plclient->child_wait != NULL)
                child_wait_free(&plclient->child_wait);
 
@@ -344,8 +343,7 @@ static
 void program_client_local_kill(struct program_client_local *plclient)
 {
        /* time to die */
-       if (plclient->to_kill != NULL)
-               timeout_remove(&plclient->to_kill);
+       timeout_remove(&plclient->to_kill);
 
        i_assert(plclient->pid != (pid_t)-1);
 
index 4e30f3d9bb683ec31bf75275a47bac3dcb6e8999..2f986c369f0717d5918414c07de13c02b2b47564 100644 (file)
@@ -282,8 +282,7 @@ int program_client_unix_connect(struct program_client *pclient)
        if (pclient->set.debug)
                i_debug("Trying to connect %s", pclient->path);
 
-       if (prclient->to_retry != NULL)
-               timeout_remove(&prclient->to_retry);
+       timeout_remove(&prclient->to_retry);
 
        if ((fd = net_connect_unix(pclient->path)) < 0) {
                switch (errno) {
@@ -355,11 +354,9 @@ void program_client_net_connect_real(struct program_client *pclient)
        struct program_client_remote *prclient =
                (struct program_client_remote *) pclient;
 
-       if (pclient->to != NULL)
-               timeout_remove(&pclient->to);
+       timeout_remove(&pclient->to);
 
-       if (prclient->to_retry != NULL)
-               timeout_remove(&prclient->to_retry);
+       timeout_remove(&prclient->to_retry);
 
        i_assert(prclient->ips_count > 0);
 
@@ -545,8 +542,7 @@ void program_client_remote_disconnect(struct program_client *pclient, bool force
        struct program_client_remote *prclient =
                (struct program_client_remote *)pclient;
 
-       if (prclient->to_retry != NULL)
-               timeout_remove(&prclient->to_retry);
+       timeout_remove(&prclient->to_retry);
 
        if (pclient->error == PROGRAM_CLIENT_ERROR_NONE && !prclient->noreply &&
            pclient->program_input != NULL && !force) {
index 09517e8c90c1b8305fabf26e5fba12572a53b25e..f8240fd4368e143a3b2f8f322ea629c6862cd829 100644 (file)
@@ -160,8 +160,7 @@ void program_client_disconnect(struct program_client *pclient, bool force)
                return;
        pclient->disconnected = TRUE;
 
-       if (pclient->to != NULL)
-               timeout_remove(&pclient->to);
+       timeout_remove(&pclient->to);
        io_remove(&pclient->io);
 
        if ((ret = program_client_close_output(pclient)) < 0)
@@ -404,8 +403,7 @@ int program_client_connected(struct program_client *pclient)
        int ret = 1;
 
        pclient->start_time = ioloop_timeval;
-       if (pclient->to != NULL)
-               timeout_remove(&pclient->to);
+       timeout_remove(&pclient->to);
        if (pclient->set.input_idle_timeout_msecs != 0) {
                pclient->to =
                        timeout_add(pclient->set.input_idle_timeout_msecs,
index c8bdc5190f8fdeb9410246e051dde20d7d1520c1..02a30f6ceffddc44a97c866dd22d4c6a58fc52c5 100644 (file)
@@ -118,8 +118,7 @@ void lmtp_client_close(struct lmtp_client *client)
 {
        if (client->dns_lookup != NULL)
                dns_lookup_abort(&client->dns_lookup);
-       if (client->to != NULL)
-               timeout_remove(&client->to);
+       timeout_remove(&client->to);
        io_remove(&client->io);
        if (client->input != NULL)
                i_stream_close(client->input);
@@ -867,10 +866,8 @@ void lmtp_client_send(struct lmtp_client *client, struct istream *data_input)
        /* now we actually want to start doing I/O. start the timeout
           handling. */
        if (client->set.timeout_secs > 0) {
-               if (client->to != NULL) {
-                       /* still waiting for connect to finish */
-                       timeout_remove(&client->to);
-               }
+               /* possibly still waiting for connect to finish */
+               timeout_remove(&client->to);
                client->to = timeout_add(client->set.timeout_secs*1000,
                                         lmtp_client_timeout, client);
        }
index 9c55750d8b6bf56a2c227a8f4ec673841b178f5f..4f81d40e2c16828a8183f9656748084bbe166078 100644 (file)
@@ -735,8 +735,7 @@ static void driver_cassandra_deinit_v(struct sql_db *_db)
        cass_session_free(db->session);
        cass_cluster_free(db->cluster);
        cass_timestamp_gen_free(db->timestamp_gen);
-       if (db->to_metrics != NULL)
-               timeout_remove(&db->to_metrics);
+       timeout_remove(&db->to_metrics);
        i_free(db->metrics_path);
        i_free(db->hosts);
        i_free(db->error);
index 842dddc395e0f8ac15a994a14c219463e009a8b2..f1985f094ab114f90fc7f74f3abc00036f430eef 100644 (file)
@@ -132,8 +132,7 @@ static void driver_pgsql_close(struct pgsql_db *db)
        PQfinish(db->pg);
        db->pg = NULL;
 
-       if (db->to_connect != NULL)
-               timeout_remove(&db->to_connect);
+       timeout_remove(&db->to_connect);
 
        driver_pgsql_set_state(db, SQL_DB_STATE_DISCONNECTED);
 
@@ -194,8 +193,7 @@ static void connect_callback(struct pgsql_db *db)
 
        if (io_dir == 0) {
                db->connect_state = "connected";
-               if (db->to_connect != NULL)
-                       timeout_remove(&db->to_connect);
+               timeout_remove(&db->to_connect);
                driver_pgsql_set_state(db, SQL_DB_STATE_IDLE);
                if (db->ioloop != NULL) {
                        /* driver_pgsql_sync_init() waiting for connection to
index dfc0450fb8f0a385e72e22a2cf645f5311817d03..18b224eac6461698e65b605a91f9fff39e11c51a 100644 (file)
@@ -227,8 +227,7 @@ sqlpool_handle_connect_failed(struct sqlpool_db *db, struct sql_db *conndb)
        conndb->connect_failure_count++;
 
        /* reconnect after the delay */
-       if (conndb->to_reconnect != NULL)
-               timeout_remove(&conndb->to_reconnect);
+       timeout_remove(&conndb->to_reconnect);
        conndb->to_reconnect = timeout_add(conndb->connect_delay * 1000,
                                           sqlpool_reconnect, conndb);
 
@@ -493,8 +492,7 @@ static void driver_sqlpool_abort_requests(struct sqlpool_db *db)
 
                sqlpool_request_abort(&request);
        }
-       if (db->request_to != NULL)
-               timeout_remove(&db->request_to);
+       timeout_remove(&db->request_to);
 }
 
 static void driver_sqlpool_deinit(struct sql_db *_db)
index 20e0e270c8f610b2ff05d9f5c29901457f125541..1f07f003d9a5ff9454d1543a13959910b16318e2 100644 (file)
@@ -87,8 +87,7 @@ void sql_deinit(struct sql_db **_db)
 
        *_db = NULL;
 
-       if (db->to_reconnect != NULL)
-               timeout_remove(&db->to_reconnect);
+       timeout_remove(&db->to_reconnect);
        db->v.deinit(db);
 }
 
@@ -121,8 +120,7 @@ int sql_connect(struct sql_db *db)
 
 void sql_disconnect(struct sql_db *db)
 {
-       if (db->to_reconnect != NULL)
-               timeout_remove(&db->to_reconnect);
+       timeout_remove(&db->to_reconnect);
        db->v.disconnect(db);
 }
 
index ec90f8940d0db6cd7120ef1c7d727d611c56d1ec..c1826bb386d0c3f816602964963042ad199ba414 100644 (file)
@@ -71,8 +71,7 @@ void mdbox_storage_destroy(struct mail_storage *_storage)
 
        mdbox_files_free(storage);
        mdbox_map_deinit(&storage->map);
-       if (storage->to_close_unused_files != NULL)
-               timeout_remove(&storage->to_close_unused_files);
+       timeout_remove(&storage->to_close_unused_files);
 
        if (array_is_created(&storage->move_from_alt_map_uids))
                array_free(&storage->move_from_alt_map_uids);
index c19461c4832e49bd2483286a63e8858c5a28430d..d428db146d680c09612e856515e097a46bfa2286 100644 (file)
@@ -512,8 +512,7 @@ void imapc_mail_fetch_flush(struct imapc_mailbox *mbox)
        imapc_command_send(cmd, str_c(mbox->pending_fetch_cmd));
 
        mbox->pending_fetch_request = NULL;
-       if (mbox->to_pending_fetch_send != NULL)
-               timeout_remove(&mbox->to_pending_fetch_send);
+       timeout_remove(&mbox->to_pending_fetch_send);
        str_truncate(mbox->pending_fetch_cmd, 0);
 }
 
index 4776e564b84c58d551be101b5f885d572de0a073..f09fd0dea45b29ee451c54b3197b63df46f64985 100644 (file)
@@ -786,10 +786,8 @@ static void imapc_mailbox_close(struct mailbox *box)
                array_free(&mbox->rseq_modseqs);
        if (mbox->sync_view != NULL)
                mail_index_view_close(&mbox->sync_view);
-       if (mbox->to_idle_delay != NULL)
-               timeout_remove(&mbox->to_idle_delay);
-       if (mbox->to_idle_check != NULL)
-               timeout_remove(&mbox->to_idle_check);
+       timeout_remove(&mbox->to_idle_delay);
+       timeout_remove(&mbox->to_idle_check);
        imapc_mail_cache_free(&mbox->prev_mail_cache);
        index_storage_mailbox_close(box);
 }
@@ -1156,8 +1154,7 @@ static void imapc_notify_changes(struct mailbox *box)
        struct imapc_command *cmd;
 
        if (box->notify_callback == NULL) {
-               if (mbox->to_idle_check != NULL)
-                       timeout_remove(&mbox->to_idle_check);
+               timeout_remove(&mbox->to_idle_check);
                return;
        }
 
index 344591f557761f6597964ac5119900c0ddcd06a6..677854267d1e3b1bf84b20bf013edc85217dc4c2 100644 (file)
@@ -613,8 +613,7 @@ static void mbox_mailbox_close(struct mailbox *box)
 
        if (mbox->mbox_global_lock_id != 0)
                mbox_unlock(mbox, mbox->mbox_global_lock_id);
-       if (mbox->keep_lock_to != NULL)
-               timeout_remove(&mbox->keep_lock_to);
+       timeout_remove(&mbox->keep_lock_to);
 
         mbox_file_close(mbox);
        if (mbox->mbox_file_stream != NULL)
index c0f4e4357677aa68e36dfe6f00390276a5552d07..dbaef5591cba73f9a44fe2abb2272d0d7d696700 100644 (file)
@@ -199,8 +199,7 @@ static void pop3c_client_disconnect(struct pop3c_client *client)
 
        if (client->dns_lookup != NULL)
                dns_lookup_abort(&client->dns_lookup);
-       if (client->to != NULL)
-               timeout_remove(&client->to);
+       timeout_remove(&client->to);
        io_remove(&client->io);
        if (client->input != NULL)
                i_stream_destroy(&client->input);
index 21c0471e2e6419441b0b8f715dcce1152e200581..2e3ab60fb8f6e101155976a6312477f89e4a8780 100644 (file)
@@ -181,10 +181,8 @@ void mailbox_list_index_notify_deinit(struct mailbox_list_notify *notify)
                mailbox_tree_deinit(&inotify->subscriptions);
        io_remove(&inotify->io_wait);
        io_remove(&inotify->io_wait_inbox);
-       if (inotify->to_wait != NULL)
-               timeout_remove(&inotify->to_wait);
-       if (inotify->to_notify != NULL)
-               timeout_remove(&inotify->to_notify);
+       timeout_remove(&inotify->to_wait);
+       timeout_remove(&inotify->to_notify);
        if (inotify->sync_ctx != NULL)
                (void)mail_index_view_sync_commit(&inotify->sync_ctx, &b);
        mail_index_view_close(&inotify->view);
@@ -927,10 +925,8 @@ void mailbox_list_index_notify_wait(struct mailbox_list_notify *notify,
        if (callback == NULL) {
                io_remove(&inotify->io_wait);
                io_remove(&inotify->io_wait_inbox);
-               if (inotify->to_wait != NULL)
-                       timeout_remove(&inotify->to_wait);
-               if (inotify->to_notify != NULL)
-                       timeout_remove(&inotify->to_notify);
+               timeout_remove(&inotify->to_wait);
+               timeout_remove(&inotify->to_notify);
        } else if (inotify->to_wait == NULL) {
                (void)io_add_notify(inotify->list_log_path, list_notify_callback,
                                    inotify, &inotify->io_wait);
index c85308faf2f76f8247eebd944a4bbda8d95dffe2..7b1a48dbcc8660c22064db6131be56dfed297524 100644 (file)
@@ -630,8 +630,7 @@ static void mailbox_list_index_deinit(struct mailbox_list *list)
 {
        struct mailbox_list_index *ilist = INDEX_LIST_CONTEXT(list);
 
-       if (ilist->to_refresh != NULL)
-               timeout_remove(&ilist->to_refresh);
+       timeout_remove(&ilist->to_refresh);
        if (ilist->index != NULL) {
                hash_table_destroy(&ilist->mailbox_hash);
                hash_table_destroy(&ilist->mailbox_names);
index 67c74e287a7a2de4f62dbc659d36c399259059a8..3bb6807e5cb78a4a9ad41e3c574c50a41b9e0e98 100644 (file)
@@ -21,8 +21,7 @@ struct mailbox_notify_file {
 
 static void notify_delay_callback(struct mailbox *box)
 {
-       if (box->to_notify_delay != NULL)
-               timeout_remove(&box->to_notify_delay);
+       timeout_remove(&box->to_notify_delay);
        box->notify_callback(box, box->notify_context);
 }
 
@@ -98,10 +97,8 @@ void mailbox_watch_remove_all(struct mailbox *box)
                i_free(file);
        }
 
-       if (box->to_notify_delay != NULL)
-               timeout_remove(&box->to_notify_delay);
-       if (box->to_notify != NULL)
-               timeout_remove(&box->to_notify);
+       timeout_remove(&box->to_notify_delay);
+       timeout_remove(&box->to_notify);
 }
 
 static void notify_extract_callback(struct mailbox *box ATTR_UNUSED)
index a20a6c335da81dec349c54d779d8f20ca8707f09..674bba9c9220664630acf81056a617088552ab33 100644 (file)
@@ -18,8 +18,7 @@ static void o_stream_test_destroy(struct iostream_private *stream)
 {
        struct test_ostream *tstream = (struct test_ostream *)stream;
 
-       if (tstream->to != NULL)
-               timeout_remove(&tstream->to);
+       timeout_remove(&tstream->to);
        if (tstream->internal_buf != NULL)
                buffer_free(&tstream->internal_buf);
 }
index bce059cc7f9dca93cdf65df82eb3f2203cf1d442..d5cfb8aebe7ab22122eee5d1ec1493cd770865f3 100644 (file)
@@ -267,8 +267,7 @@ void connection_init_from_streams(struct connection_list *list,
 static void connection_socket_connected(struct connection *conn)
 {
        io_remove(&conn->io);
-       if (conn->to != NULL)
-               timeout_remove(&conn->to);
+       timeout_remove(&conn->to);
 
        errno = net_geterror(conn->fd_in);
        connection_client_connected(conn, errno == 0);
@@ -311,8 +310,7 @@ void connection_disconnect(struct connection *conn)
 {
        conn->last_input = 0;
        i_zero(&conn->last_input_tv);
-       if (conn->to != NULL)
-               timeout_remove(&conn->to);
+       timeout_remove(&conn->to);
        io_remove(&conn->io);
        if (conn->input != NULL) {
                i_stream_close(conn->input);
index 49229dcde2440d82d7719be357a2fa888077288e..2a45099c669ba099800ad0f53096ca980db0dc2d 100644 (file)
@@ -22,8 +22,7 @@ static void i_stream_timeout_close(struct iostream_private *stream,
 {
        struct timeout_istream *tstream = (struct timeout_istream *)stream;
 
-       if (tstream->to != NULL)
-               timeout_remove(&tstream->to);
+       timeout_remove(&tstream->to);
        if (close_parent)
                i_stream_close(tstream->istream.parent);
 }
index a626ffb955c88df5a8cdab1dc99a9dd080d1f066..018a3113e90ed25a3d690540e9eb665f6b123fb4 100644 (file)
@@ -40,8 +40,7 @@ void log_throttle_deinit(struct log_throttle **_throttle)
        struct log_throttle *throttle = *_throttle;
 
        *_throttle = NULL;
-       if (throttle->to_throttled != NULL)
-               timeout_remove(&throttle->to_throttled);
+       timeout_remove(&throttle->to_throttled);
        i_free(throttle);
 }
 
index 65fdaf2937168171fb983e8442f73e5c2eb95aea..374e0fb4c92629df4d07a6177824ba490e3f9d8b 100644 (file)
@@ -96,8 +96,7 @@ const char *run_pump(struct istream *in, struct ostream *out, int *counter, buff
        io_loop_run(current_ioloop);
 
        timeout_remove(&to);
-       if (to2 != NULL)
-               timeout_remove(&to2);
+       timeout_remove(&to2);
        alarm(0);
 
        test_assert(*counter == 0);
index 23cfc00e3c9460ecfcb1bd55fc6b63bde5ca75ff..72540cea470b4ba4237937ae48b543fcb96e072f 100644 (file)
@@ -227,8 +227,7 @@ const char *client_remote_id(struct client *client)
 void client_io_reset(struct client *client)
 {
        io_remove(&client->io);
-       if (client->to_idle != NULL)
-               timeout_remove(&client->to_idle);
+       timeout_remove(&client->to_idle);
        client->io = io_add(client->fd_in, IO_READ, client_input, client);
         client->last_input = ioloop_time;
        client->to_idle = timeout_add(CLIENT_IDLE_TIMEOUT_MSECS,
@@ -295,8 +294,7 @@ void client_destroy(struct client *client, const char *prefix,
        if (client->proxy != NULL)
                lmtp_proxy_deinit(&client->proxy);
        io_remove(&client->io);
-       if (client->to_idle != NULL)
-               timeout_remove(&client->to_idle);
+       timeout_remove(&client->to_idle);
        if (client->ssl_iostream != NULL)
                ssl_iostream_destroy(&client->ssl_iostream);
        i_stream_destroy(&client->input);
index cd75210f0c07c1bf9992656e907cfbe2cc844861..27869dc8bee37eb89b1cfa543edcba365b6b5c12 100644 (file)
@@ -1183,8 +1183,7 @@ static void client_input_data_write(struct client *client)
        struct istream *input;
 
        /* stop handling client input until saving/proxying is finished */
-       if (client->to_idle != NULL)
-               timeout_remove(&client->to_idle);
+       timeout_remove(&client->to_idle);
        io_remove(&client->io);
        i_stream_destroy(&client->dot_input);
 
index 4c3c88b63117eeb348c2aa8ceb8176fccfb987e0..0db4287e41198096ac847dd47434a89619fd088e 100644 (file)
@@ -106,8 +106,7 @@ void lmtp_proxy_deinit(struct lmtp_proxy **_proxy)
                i_stream_unref(&proxy->data_input);
        if (proxy->client_output != NULL)
                o_stream_unref(&proxy->client_output);
-       if (proxy->to_finish != NULL)
-               timeout_remove(&proxy->to_finish);
+       timeout_remove(&proxy->to_finish);
        array_free(&proxy->rcpt_to);
        array_free(&proxy->connections);
        pool_unref(&proxy->pool);
@@ -218,8 +217,7 @@ static void lmtp_conn_finish(void *context)
        struct lmtp_proxy_connection *conn = context;
 
        conn->finished = TRUE;
-       if (conn->to != NULL)
-               timeout_remove(&conn->to);
+       timeout_remove(&conn->to);
        if (conn->data_input != NULL)
                i_stream_unref(&conn->data_input);
        lmtp_proxy_try_finish(conn->proxy);
index 7f5b509ba646fd535d9ce2978c4ef9bde6d2d6ee..c9af9aa33c607bd1e92119061a806ee669dcf6e7 100644 (file)
@@ -108,8 +108,7 @@ void access_lookup_destroy(struct access_lookup **_lookup)
 
        *_lookup = NULL;
 
-       if (lookup->to != NULL)
-               timeout_remove(&lookup->to);
+       timeout_remove(&lookup->to);
        io_remove(&lookup->io);
        if (close(lookup->fd) < 0)
                i_error("close(%s) failed: %m", lookup->path);
index 92709b46a73b11719e78c9adf8aaeba481a47a3d..4f69de395c52c280e5e76277f8657cb8f908ee20 100644 (file)
@@ -674,8 +674,7 @@ sasl_callback(struct client *client, enum sasl_server_reply sasl_reply,
        i_zero(&reply);
        switch (sasl_reply) {
        case SASL_SERVER_REPLY_SUCCESS:
-               if (client->to_auth_waiting != NULL)
-                       timeout_remove(&client->to_auth_waiting);
+               timeout_remove(&client->to_auth_waiting);
                if (args != NULL) {
                        client_auth_parse_args(client, TRUE, args, &reply);
                        reply.all_fields = args;
@@ -689,8 +688,7 @@ sasl_callback(struct client *client, enum sasl_server_reply sasl_reply,
                break;
        case SASL_SERVER_REPLY_AUTH_FAILED:
        case SASL_SERVER_REPLY_AUTH_ABORTED:
-               if (client->to_auth_waiting != NULL)
-                       timeout_remove(&client->to_auth_waiting);
+               timeout_remove(&client->to_auth_waiting);
                if (args != NULL) {
                        client_auth_parse_args(client, FALSE, args, &reply);
                        client->last_auth_fail = reply.fail_code;
@@ -738,8 +736,7 @@ sasl_callback(struct client *client, enum sasl_server_reply sasl_reply,
                i_assert(client->v.auth_send_challenge != NULL);
                client->v.auth_send_challenge(client, data);
 
-               if (client->to_auth_waiting != NULL)
-                       timeout_remove(&client->to_auth_waiting);
+               timeout_remove(&client->to_auth_waiting);
 
                if (client->auth_response != NULL)
                        str_truncate(client->auth_response, 0);
@@ -821,8 +818,7 @@ void clients_notify_auth_connected(void)
        for (client = clients; client != NULL; client = next) {
                next = client->next;
 
-               if (client->to_auth_waiting != NULL)
-                       timeout_remove(&client->to_auth_waiting);
+               timeout_remove(&client->to_auth_waiting);
 
                client_notify_auth_ready(client);
 
index c9f394d0c305ea42e8176b83c8ba5b2c316f2c8e..a0a0f51076c97152884a1806e435f0913eed2ef6 100644 (file)
@@ -264,10 +264,8 @@ void client_destroy(struct client *client, const char *reason)
        }
 
        io_remove(&client->io);
-       if (client->to_disconnect != NULL)
-               timeout_remove(&client->to_disconnect);
-       if (client->to_auth_waiting != NULL)
-               timeout_remove(&client->to_auth_waiting);
+       timeout_remove(&client->to_disconnect);
+       timeout_remove(&client->to_auth_waiting);
        if (client->auth_response != NULL)
                str_free(&client->auth_response);
 
index f01c33d6088304009ca0ac6d6e9d849357e961c0..05509ed35685c869d28749c9f786dcb0d821ef87 100644 (file)
@@ -77,8 +77,7 @@ void login_proxy_state_deinit(struct login_proxy_state **_state)
                i_assert(rec->num_waiting_connections == 0);
        hash_table_iterate_deinit(&iter);
 
-       if (state->to_reopen != NULL)
-               timeout_remove(&state->to_reopen);
+       timeout_remove(&state->to_reopen);
        login_proxy_state_close(state);
        hash_table_destroy(&state->hash);
        pool_unref(&state->pool);
index 49f80a8204dee42b44fdbdf21d8ce3f963eb520e..860b27fa460d57977ca81e0f1db527b667a8e84c 100644 (file)
@@ -465,10 +465,8 @@ int login_proxy_new(struct client *client,
 
 static void login_proxy_disconnect(struct login_proxy *proxy)
 {
-       if (proxy->to != NULL)
-               timeout_remove(&proxy->to);
-       if (proxy->to_notify != NULL)
-               timeout_remove(&proxy->to_notify);
+       timeout_remove(&proxy->to);
+       timeout_remove(&proxy->to_notify);
 
        if (!proxy->num_waiting_connections_updated) {
                i_assert(proxy->state_rec->num_waiting_connections > 0);
@@ -705,8 +703,7 @@ void login_proxy_detach(struct login_proxy *proxy)
        i_assert(proxy->server_input != NULL);
        i_assert(proxy->server_output != NULL);
 
-       if (proxy->to != NULL)
-               timeout_remove(&proxy->to);
+       timeout_remove(&proxy->to);
 
        proxy->client_fd = i_stream_get_fd(client->input);
        proxy->client_input = client->input;
index 573f4934dd74982a7f3e1c0b833133b1c8deedad..773c01ade7b7b451361ce3120c059dcee8cd629a 100644 (file)
@@ -146,8 +146,7 @@ client_connected_finish(const struct master_service_connection *conn)
                ssl_proxy_start(proxy);
        }
 
-       if (auth_client_to != NULL)
-               timeout_remove(&auth_client_to);
+       timeout_remove(&auth_client_to);
 }
 
 static void login_access_lookup_free(struct login_access_lookup *lookup)
@@ -437,8 +436,7 @@ static void main_deinit(void)
 
        if (anvil != NULL)
                anvil_client_deinit(&anvil);
-       if (auth_client_to != NULL)
-               timeout_remove(&auth_client_to);
+       timeout_remove(&auth_client_to);
        client_common_deinit();
        dsasl_clients_deinit();
        login_settings_deinit();
index 1e29515727964092e725e4b6b7c8652ec9c26e00..cb19b68678ee1f4e907a0dcba11d5108d713f24d 100644 (file)
@@ -342,8 +342,7 @@ static void instance_update_now(struct master_instance_list *list)
                (void)master_instance_list_update(list, services->set->base_dir);
        }
        
-       if (to_instance != NULL)
-               timeout_remove(&to_instance);
+       timeout_remove(&to_instance);
        to_instance = timeout_add((3600 * 12 + i_rand_limit(60 * 30)) * 1000,
                                  instance_update_now, list);
 }
index 67be42c466a6f4d62f4aa7f40f1fcce4d65fbb76..c13d6bf84ac7a2ca9f30b921bdf9b31f0662a983 100644 (file)
@@ -68,8 +68,7 @@ static void service_status_more(struct service_process *process,
                process->available_count - status->available_count;
        process->idle_start = 0;
 
-       if (process->to_idle != NULL)
-               timeout_remove(&process->to_idle);
+       timeout_remove(&process->to_idle);
 
        if (status->available_count != 0)
                return;
@@ -146,10 +145,8 @@ service_status_input_one(struct service *service,
        }
        process->last_status_update = ioloop_time;
 
-       if (process->to_status != NULL) {
-               /* first status notification */
-               timeout_remove(&process->to_status);
-       }
+       /* first status notification */
+       timeout_remove(&process->to_status);
 
        if (process->available_count == status->available_count)
                return;
@@ -375,8 +372,7 @@ static void service_monitor_listen_start_force(struct service *service)
 
        service->listening = TRUE;
        service->listen_pending = FALSE;
-       if (service->to_drop != NULL)
-               timeout_remove(&service->to_drop);
+       timeout_remove(&service->to_drop);
 
        array_foreach(&service->listeners, listeners) {
                struct service_listener *l = *listeners;
@@ -407,8 +403,7 @@ void service_monitor_listen_stop(struct service *service)
        }
        service->listening = FALSE;
        service->listen_pending = FALSE;
-       if (service->to_drop != NULL)
-               timeout_remove(&service->to_drop);
+       timeout_remove(&service->to_drop);
 }
 
 static int service_login_create_notify_fd(struct service *service)
@@ -545,14 +540,11 @@ void service_monitor_stop(struct service *service)
                }
                service->login_notify_fd = -1;
        }
-       if (service->to_login_notify != NULL)
-               timeout_remove(&service->to_login_notify);
+       timeout_remove(&service->to_login_notify);
        service_monitor_listen_stop(service);
 
-       if (service->to_throttle != NULL)
-               timeout_remove(&service->to_throttle);
-       if (service->to_prefork != NULL)
-               timeout_remove(&service->to_prefork);
+       timeout_remove(&service->to_throttle);
+       timeout_remove(&service->to_prefork);
 }
 
 void service_monitor_stop_close(struct service *service)
index fdbde999676db17d1c55f818500c6ca1703fb3a6..c869da1a64a7134fa35e4eb184d41489c1629890 100644 (file)
@@ -374,10 +374,8 @@ void service_process_destroy(struct service_process *process)
        service->process_count--;
        i_assert(service->process_avail <= service->process_count);
 
-       if (process->to_status != NULL)
-               timeout_remove(&process->to_status);
-       if (process->to_idle != NULL)
-               timeout_remove(&process->to_idle);
+       timeout_remove(&process->to_status);
+       timeout_remove(&process->to_idle);
        if (service->list->log_byes != NULL)
                service_process_notify_add(service->list->log_byes, process);
 
index c853f4334fbe0a884d4b45eac2b070570d69f0f2..f57044886cb96630f1be136d2a575d86af672bfb 100644 (file)
@@ -535,8 +535,7 @@ static void service_login_notify_send(struct service *service)
        unsigned int uninitialized_count;
 
        service->last_login_notify_time = ioloop_time;
-       if (service->to_login_notify != NULL)
-               timeout_remove(&service->to_login_notify);
+       timeout_remove(&service->to_login_notify);
 
        service_signal(service, SIGUSR1, &uninitialized_count);
 }
@@ -660,8 +659,7 @@ void service_list_unref(struct service_list *service_list)
        if (--service_list->refcount > 0)
                return;
 
-       if (service_list->to_kill != NULL)
-               timeout_remove(&service_list->to_kill);
+       timeout_remove(&service_list->to_kill);
        pool_unref(&service_list->set_pool);
        pool_unref(&service_list->pool);
 }
index cbdb0cc82af24393814d4f5d8aeb7f1e48fcb19d..d281b3507f8fc6824131185e6e68e84e94f62895 100644 (file)
@@ -35,8 +35,7 @@ static void last_login_dict_deinit(struct mail_user *user)
        }
        /* remove timeout after dict_wait(), which may trigger
           last_login_dict_commit() */
-       if (luser->to != NULL)
-               timeout_remove(&luser->to);
+       timeout_remove(&luser->to);
 }
 
 static void last_login_user_deinit(struct mail_user *user)
index 45017cf4f9c7fa3d99f45f6b8a26ba230b5563c4..21c109537820632e4ebfe4e9f9a1ea93c98d6026 100644 (file)
@@ -73,8 +73,7 @@ static void mail_crypt_cache_close(struct mail_crypt_user *muser)
 {
        struct mail_crypt_cache *cache = &muser->cache;
 
-       if (cache->to != NULL)
-               timeout_remove(&cache->to);
+       timeout_remove(&cache->to);
        if (cache->input != NULL)
                i_stream_unref(&cache->input);
        i_zero(cache);
index d9686896ec3d7892817c2831a66228e0de1b4f3c..eefb2f8cc9679807d01388d547edcacb14c41c8a 100644 (file)
@@ -103,8 +103,7 @@ static void quota_clone_flush(struct mailbox *box)
        struct quota_clone_user *quser =
                QUOTA_CLONE_USER_CONTEXT(box->storage->user);
 
-       if (qbox->to_quota_flush != NULL)
-               timeout_remove(&qbox->to_quota_flush);
+       timeout_remove(&qbox->to_quota_flush);
 
        if (quser->quota_flushing) {
                /* recursing back from quota recalculation */
index d843c5915a90ebb429298e62a17b978a4e0e1fea..a406980c83fcadca56e8c02378ebf8a1e5f4a7d5 100644 (file)
@@ -138,8 +138,7 @@ static void session_stats_refresh(struct mail_user *user)
                                                   suser->session_stats);
        }
 
-       if (suser->to_stats_timeout != NULL)
-               timeout_remove(&suser->to_stats_timeout);
+       timeout_remove(&suser->to_stats_timeout);
        suser->to_stats_timeout =
                timeout_add(to_next_secs*1000,
                            session_stats_refresh_timeout, user);
@@ -341,8 +340,7 @@ static void stats_user_deinit(struct mail_user *user)
        if (suser->stats_connected)
                mail_stats_connection_disconnect(stats_conn, user);
 
-       if (suser->to_stats_timeout != NULL)
-               timeout_remove(&suser->to_stats_timeout);
+       timeout_remove(&suser->to_stats_timeout);
        suser->module_ctx.super.deinit(user);
 
        stats_connection_unref(&stats_conn);
index 24356786518a780b80d63db0854b916e750bce0d..4600e2b8a213b27e81bfc71d9077b6145790ed33 100644 (file)
@@ -68,8 +68,7 @@ static void zlib_mail_cache_close(struct zlib_user *zuser)
 {
        struct zlib_mail_cache *cache = &zuser->cache;
 
-       if (cache->to != NULL)
-               timeout_remove(&cache->to);
+       timeout_remove(&cache->to);
        if (cache->input != NULL)
                i_stream_unref(&cache->input);
        i_zero(cache);
index 548acfd25672a7c2c41037d18a923264e3f08a0d..bbfe8cb7dfb4c079a55e72bdf0125e5c6c9ee60a 100644 (file)
@@ -603,8 +603,7 @@ static void client_default_destroy(struct client *client, const char *reason)
 
        if (client->session_dotlock != NULL)
                file_dotlock_delete(&client->session_dotlock);
-       if (client->to_session_dotlock_refresh != NULL)
-               timeout_remove(&client->to_session_dotlock_refresh);
+       timeout_remove(&client->to_session_dotlock_refresh);
 
        if (client->uidl_pool != NULL)
                pool_unref(&client->uidl_pool);
@@ -615,8 +614,7 @@ static void client_default_destroy(struct client *client, const char *reason)
 
        io_remove(&client->io);
        timeout_remove(&client->to_idle);
-       if (client->to_commit != NULL)
-               timeout_remove(&client->to_commit);
+       timeout_remove(&client->to_commit);
 
        i_stream_destroy(&client->input);
        o_stream_destroy(&client->output);
@@ -659,8 +657,7 @@ void client_disconnect(struct client *client, const char *reason)
        i_stream_close(client->input);
        o_stream_close(client->output);
 
-       if (client->to_idle != NULL)
-               timeout_remove(&client->to_idle);
+       timeout_remove(&client->to_idle);
        client->to_idle = timeout_add(0, client_destroy_timeout, client);
 }
 
index 00f662e9a59bf70d8fd6222e887f3fafa7207b14..270c04a2a39017195fb07f413b4de3f5da794298 100644 (file)
@@ -167,8 +167,7 @@ static void replicator_connection_connect(struct replicator_connection *conn)
                return;
        }
 
-       if (conn->to != NULL)
-               timeout_remove(&conn->to);
+       timeout_remove(&conn->to);
        conn->fd = fd;
        conn->io = io_add(fd, IO_READ, replicator_input, conn);
        conn->input = i_stream_create_fd(fd, MAX_INBUF_SIZE);
@@ -255,8 +254,7 @@ void replicator_connection_destroy(struct replicator_connection **_conn)
        for (i = REPLICATION_PRIORITY_LOW; i <= REPLICATION_PRIORITY_SYNC; i++)
                buffer_free(&conn->queue[i]);
 
-       if (conn->to != NULL)
-               timeout_remove(&conn->to);
+       timeout_remove(&conn->to);
        hash_table_destroy(&conn->requests);
        i_free(conn);
 }
index cc3fd868181d48594877adbc88707e08e361a8d1..ecf6da8a1399e5e7ba4158d4b25758f56c2f5718 100644 (file)
@@ -52,8 +52,7 @@ static void dsync_callback(struct dsync_client *client,
        dsync_callback_t *callback = client->callback;
        void *context = client->context;
 
-       if (client->to != NULL)
-               timeout_remove(&client->to);
+       timeout_remove(&client->to);
 
        client->callback = NULL;
        client->context = NULL;
index 0769cf63180c5d93bf5abeb2c58175143f3d4f73..6f9721046e67dcdd7e5c457ffe616142a5e04a12 100644 (file)
@@ -62,8 +62,7 @@ void replicator_brain_deinit(struct replicator_brain **_brain)
        brain->deinitializing = TRUE;
        array_foreach_modifiable(&brain->dsync_clients, connp)
                dsync_client_deinit(connp);
-       if (brain->to != NULL)
-               timeout_remove(&brain->to);
+       timeout_remove(&brain->to);
        pool_unref(&brain->pool);
 }
 
@@ -173,8 +172,7 @@ static bool replicator_brain_fill_next(struct replicator_brain *brain)
        user = replicator_queue_pop(brain->queue, &next_secs);
        if (user == NULL) {
                /* nothing more to do */
-               if (brain->to != NULL)
-                       timeout_remove(&brain->to);
+               timeout_remove(&brain->to);
                brain->to = timeout_add(next_secs * 1000,
                                        replicator_brain_timeout, brain);
                return FALSE;
index 876c53062a96ed28c7d1b0b6879cf7c1aa95fe08..ae066648e38a821f50b32ba933c618ee441464ac 100644 (file)
@@ -74,8 +74,7 @@ static void client_input(struct client *client)
        const char *const *args, *error;
        int ret;
 
-       if (client->to_pending != NULL)
-               timeout_remove(&client->to_pending);
+       timeout_remove(&client->to_pending);
 
        switch (i_stream_read(client->input)) {
        case -2:
index 84a5baaf3a36c66be06f0ca9b766dd537dc05892..3b1a7d81417386bfb7ec0952d6dc18c807a036cd 100644 (file)
@@ -157,8 +157,7 @@ static void mail_session_free(struct mail_session *session)
 
        global_memory_free(mail_session_memsize(session));
 
-       if (session->to_idle != NULL)
-               timeout_remove(&session->to_idle);
+       timeout_remove(&session->to_idle);
        if (!session->disconnected)
                hash_table_remove(mail_sessions_hash, session->id);
        DLLIST_REMOVE_FULL(&stable_mail_sessions, session,
index dad728fbfca55f1c2c4429c453e18618ca8939a1..8e580e55cdb11e2a42babc75690225547bed0b70 100644 (file)
@@ -34,8 +34,7 @@ stats_carbon_destroy(struct stats_send_ctx **_ctx)
        *_ctx = NULL;
 
        io_remove(&ctx->io);
-       if (ctx->to != NULL)
-               timeout_remove(&ctx->to);
+       timeout_remove(&ctx->to);
        i_close_fd(&ctx->fd);
        pool_unref(&ctx->pool);
 }
index 6c0c36da4042c6b8d1f6d035e758cac3ca0d50f7..f0f4ef7f54d4b521ae2a834e0b03edd7095b1890 100644 (file)
@@ -63,8 +63,7 @@ static void rawlog_proxy_destroy(struct rawlog_proxy *proxy)
        }
        io_remove(&proxy->client_io);
        io_remove(&proxy->server_io);
-       if (proxy->to_flush != NULL)
-               timeout_remove(&proxy->to_flush);
+       timeout_remove(&proxy->to_flush);
 
        o_stream_destroy(&proxy->client_output);
        o_stream_destroy(&proxy->server_output);