const char *line;
int ret;
- if (conn->to_input != NULL)
- timeout_remove(&conn->to_input);
+ timeout_remove(&conn->to_input);
while ((line = i_stream_next_line(conn->input)) != NULL) {
T_BEGIN {
}
if (array_count(&conn->cmds) >= DICT_CONN_MAX_PENDING_COMMANDS) {
io_remove(&conn->io);
- if (conn->to_input != NULL)
- timeout_remove(&conn->to_input);
+ timeout_remove(&conn->to_input);
break;
}
}
i_assert(expire_timestamp > ioloop_time || expire_timestamp == 0);
if (expire_timestamp != dir->to_expire_timestamp) {
- if (dir->to_expire != NULL)
- timeout_remove(&dir->to_expire);
+ timeout_remove(&dir->to_expire);
if (expire_timestamp != 0) {
struct timeval tv = { .tv_sec = expire_timestamp };
dir->to_expire_timestamp = tv.tv_sec;
while (dir->head != NULL)
user_free(dir, dir->head);
- if (dir->to_expire != NULL)
- timeout_remove(&dir->to_expire);
+ timeout_remove(&dir->to_expire);
hash_table_destroy(&dir->hash);
array_free(&dir->iters);
i_free(dir);
mailbox_notify_changes_stop(client->mailbox);
ctx->watching_mailbox = FALSE;
}
- if (ctx->to_watch != NULL)
- timeout_remove(&ctx->to_watch);
+ timeout_remove(&ctx->to_watch);
}
int imap_notify_begin(struct imap_notify_context *ctx)
http_client_host_shared_debug(hshared, "Host destroy");
- if (hshared->to_idle != NULL)
- timeout_remove(&hshared->to_idle);
+ timeout_remove(&hshared->to_idle);
DLLIST_REMOVE(&cctx->hosts_list, hshared);
if (hshared == cctx->unix_host)
(const struct http_client_peer_addr *)&pshared->addr);
DLLIST_REMOVE(&pshared->cctx->peers_list, pshared);
- if (pshared->to_backoff != NULL)
- timeout_remove(&pshared->to_backoff);
+ timeout_remove(&pshared->to_backoff);
i_free(pshared->addr_name);
i_free(pshared->label);
http_client_connection_lost_peer(*conn);
i_assert(array_count(&peer->conns) == 0);
- if (peer->to_req_handling != NULL)
- timeout_remove(&peer->to_req_handling);
+ timeout_remove(&peer->to_req_handling);
/* unlist in client */
DLLIST_REMOVE_FULL
static void http_client_peer_handle_requests(struct http_client_peer *peer)
{
- if (peer->to_req_handling != NULL)
- timeout_remove(&peer->to_req_handling);
+ timeout_remove(&peer->to_req_handling);
T_BEGIN {
http_client_peer_handle_requests_real(peer);
array_free(&queue->delayed_requests);
/* cancel timeouts */
- if (queue->to_connect != NULL)
- timeout_remove(&queue->to_connect);
- if (queue->to_delayed != NULL)
- timeout_remove(&queue->to_delayed);
+ timeout_remove(&queue->to_connect);
+ timeout_remove(&queue->to_delayed);
/* free */
i_free(queue->addr_name);
t_strflocaltime("%Y-%m-%d %H:%M:%S", ioloop_timeval.tv_sec),
((unsigned long)ioloop_timeval.tv_usec)/1000);
- if (queue->to_request != NULL)
- timeout_remove(&queue->to_request);
+ timeout_remove(&queue->to_request);
/* collect failed requests */
reqs = array_get(&queue->requests, &count);
cmd->callback(&reply, cmd->context);
imapc_command_free(cmd);
}
- if (conn->to != NULL)
- timeout_remove(&conn->to);
+ timeout_remove(&conn->to);
}
static void
unsigned int i = 0, n;
struct ldap_op_queue_entry *req;
- if (conn->to_reconnect != NULL)
- timeout_remove(&(conn->to_reconnect));
+ timeout_remove(&(conn->to_reconnect));
if (conn->state == LDAP_STATE_DISCONNECT) {
if (ldap_connection_connect(conn) == -1)
{
if (conn->io != NULL)
io_remove_closed(&(conn->io));
- if (conn->to_disconnect != NULL)
- timeout_remove(&(conn->to_disconnect));
- if (conn->to_reconnect != NULL)
- timeout_remove(&(conn->to_reconnect));
+ timeout_remove(&(conn->to_disconnect));
+ timeout_remove(&(conn->to_reconnect));
if (conn->request_queue != NULL) {
unsigned int n = aqueue_count(conn->request_queue);
/* connection failure. add a delayed failure callback.
the caller may not expect the callback to be called
immediately. */
- if (client->to_query != NULL)
- timeout_remove(&client->to_query);
+ timeout_remove(&client->to_query);
client->to_query =
timeout_add_short(0, anvil_client_cancel_queries, client);
} else if (client->to_query == NULL) {
service->master_status.available_count ==
service->last_sent_status_avail_count) {
/* a) closed, b) updating to same state */
- if (service->to_status != NULL)
- timeout_remove(&service->to_status);
+ timeout_remove(&service->to_status);
if (service->io_status_write != NULL)
io_remove(&service->io_status_write);
return;
/* have to move our existing I/O and timeout handlers to new I/O loop */
io_remove(&db->io);
- if (db->to_connect != NULL) {
- timeout_remove(&db->to_connect);
- add_to_connect = TRUE;
- } else {
- add_to_connect = FALSE;
- }
+
+ add_to_connect = (db->to_connect != NULL);
+ timeout_remove(&db->to_connect);
db->ioloop = io_loop_create();
if (add_to_connect) {
void lucene_index_close(struct lucene_index *index)
{
- if (index->to_close != NULL)
- timeout_remove(&index->to_close);
+ timeout_remove(&index->to_close);
_CLDELETE(index->searcher);
if (index->writer != NULL) {