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);
}
count = aqueue_count(auth_failures);
if (count == 0) {
- if (to_auth_failures != NULL)
- timeout_remove(&to_auth_failures);
+ timeout_remove(&to_auth_failures);
return;
}
array_free(&auth_failures_arr);
aqueue_deinit(&auth_failures);
- if (to_auth_failures != NULL)
- timeout_remove(&to_auth_failures);
+ timeout_remove(&to_auth_failures);
}
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. */
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);
{
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);
}
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);
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);
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");
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);
}
}
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))
;
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;
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);
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);
}
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);
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();
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);
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);
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);
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);
(*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;
{
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");
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)",
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 =
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);
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;
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);
}
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;
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(¬ify_conn);
/* deinit doveadm connections before director, so it can clean up
{
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) {
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)
&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);
}
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(¬ify->io);
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);
}
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;
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);
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);
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);
{
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 */
{
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);
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);
}
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 */
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);
}
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();
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) {
if (notify_ns->notify != NULL)
mailbox_list_notify_deinit(¬ify_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);
(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);
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,
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;
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);
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();
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) {
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);
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,
/* 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;
} 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);
}
}
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);
}
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);
*_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)
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;
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
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,
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)
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:
/* 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;
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;
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);
{
peer->backoff_time_msecs = 0;
- if (peer->to_backoff != NULL)
- timeout_remove(&peer->to_backoff);
+ timeout_remove(&peer->to_backoff);
}
static void
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 */
/* 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) {
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
/* 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,
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,
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);
}
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);
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
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);
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);
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);
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");
}
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);
}
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);
}
}
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);
}
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)
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);
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
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 */
(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) {
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
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);
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'",
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);
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);
}
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);
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);
}
*_req = NULL;
- if (req->to_abort != NULL)
- timeout_remove(&req->to_abort);
+ timeout_remove(&req->to_abort);
pool_unref(&req->pool);
}
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);
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);
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);
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)
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)
{
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) {
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);
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)
}
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)
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);
}
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:
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))
{
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));
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);
}
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);
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);
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) {
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);
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) {
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)
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,
{
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);
/* 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);
}
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);
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);
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
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);
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)
*_db = NULL;
- if (db->to_reconnect != NULL)
- timeout_remove(&db->to_reconnect);
+ timeout_remove(&db->to_reconnect);
db->v.deinit(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);
}
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);
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);
}
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);
}
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;
}
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)
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);
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);
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);
{
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);
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);
}
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)
{
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);
}
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);
{
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);
{
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);
}
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);
}
io_loop_run(current_ioloop);
timeout_remove(&to);
- if (to2 != NULL)
- timeout_remove(&to2);
+ timeout_remove(&to2);
alarm(0);
test_assert(*counter == 0);
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,
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);
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);
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);
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);
*_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);
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;
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;
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);
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);
}
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);
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);
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);
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;
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)
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();
(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);
}
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;
}
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;
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;
}
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)
}
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)
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);
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);
}
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);
}
}
/* 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)
{
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);
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 */
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);
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);
{
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);
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);
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);
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);
}
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);
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);
}
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;
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);
}
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;
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:
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,
*_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);
}
}
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);