master_service_run(master_service, client_connected);
- if (log_fdpass_io != NULL)
- io_remove(&log_fdpass_io);
+ io_remove(&log_fdpass_io);
penalty_deinit(&penalty);
connect_limit_deinit(&connect_limit);
anvil_connections_destroy_all();
OUTBUF_THROTTLE_SIZE) {
/* stop reading new requests until client has read the pending
replies. */
- if (conn->io != NULL)
- io_remove(&conn->io);
+ io_remove(&conn->io);
}
if (conn->auth->set->debug) {
i_stream_close(conn->input);
o_stream_close(conn->output);
- if (conn->io != NULL)
- io_remove(&conn->io);
+ io_remove(&conn->io);
net_disconnect(conn->fd);
conn->fd = -1;
i_stream_close(conn->input);
if (conn->output != NULL)
o_stream_close(conn->output);
- if (conn->io != NULL)
- io_remove(&conn->io);
+ io_remove(&conn->io);
if (conn->fd != -1) {
if (close(conn->fd) < 0)
i_error("close(%s): %m", conn->path);
i_stream_close(conn->input);
if (conn->output != NULL)
o_stream_close(conn->output);
- if (conn->io != NULL)
- io_remove(&conn->io);
+ io_remove(&conn->io);
if (conn->fd != -1) {
if (close(conn->fd) < 0)
i_error("close(%s): %m", conn->path);
OUTBUF_THROTTLE_SIZE) {
/* stop reading new requests until client has read the pending
replies. */
- if (client->io != NULL)
- io_remove(&client->io);
+ io_remove(&client->io);
}
}
if (client->to_idle != NULL)
timeout_remove(&client->to_idle);
- if (client->io != NULL)
- io_remove(&client->io);
+ io_remove(&client->io);
net_disconnect(client->fd);
client->fd = -1;
conn->request->context);
}
- if (conn->io != NULL)
- io_remove(&conn->io);
+ io_remove(&conn->io);
i_stream_destroy(&conn->input);
o_stream_destroy(&conn->output);
if (conn->to != NULL)
static void checkpassword_request_close(struct chkpw_auth_request *request)
{
- if (request->io_in != NULL)
- io_remove(&request->io_in);
- if (request->io_out != NULL)
- io_remove(&request->io_out);
+ io_remove(&request->io_in);
+ io_remove(&request->io_out);
if (request->fd_in != -1) {
if (close(request->fd_in) < 0)
void db_ldap_enable_input(struct ldap_connection *conn, bool enable)
{
if (!enable) {
- if (conn->io != NULL)
- io_remove(&conn->io);
+ io_remove(&conn->io);
} else {
if (conn->io == NULL && conn->fd != -1) {
conn->io = io_add(conn->fd, IO_READ, ldap_input, conn);
}
conn->fd = -1;
- if (conn->io != NULL) {
- /* the fd may have already been closed before ldap_unbind(),
- so we'll have to use io_remove_closed(). */
- io_remove_closed(&conn->io);
- }
+ /* the fd may have already been closed before ldap_unbind(),
+ so we'll have to use io_remove_closed(). */
+ io_remove_closed(&conn->io);
if (aqueue_count(conn->request_queue) > 0) {
conn->to = timeout_add(DB_LDAP_REQUEST_DISCONNECT_TIMEOUT_SECS *
if (conn->to_input != NULL)
timeout_remove(&conn->to_input);
- if (conn->io != NULL)
- io_remove(&conn->io);
+ io_remove(&conn->io);
i_stream_close(conn->input);
o_stream_close(conn->output);
if (close(conn->fd) < 0)
if (conn->to_pong != NULL)
timeout_remove(&conn->to_pong);
timeout_remove(&conn->to_ping);
- if (conn->io != NULL)
- io_remove(&conn->io);
+ io_remove(&conn->io);
i_stream_unref(&conn->input);
o_stream_unref(&conn->output);
if (close(conn->fd) < 0)
if (conn->to_delay != NULL)
timeout_remove(&conn->to_delay);
- if (conn->in_io != NULL)
- io_remove(&conn->in_io);
+ io_remove(&conn->in_io);
i_stream_unref(&conn->in_input);
o_stream_unref(&conn->in_output);
net_disconnect(conn->in_fd);
- if (conn->out_io != NULL)
- io_remove(&conn->out_io);
+ io_remove(&conn->out_io);
i_stream_unref(&conn->out_input);
o_stream_unref(&conn->out_output);
net_disconnect(conn->out_fd);
if (conn->output != NULL)
o_stream_destroy(&conn->output);
- if (conn->io != NULL) {
- io_remove(&conn->io);
- }
+ io_remove(&conn->io);
if (conn->input != NULL) {
i_stream_destroy(&conn->input);
i_stream_skip(ctx->err_stream, size);
break;
case -1:
- if (ctx->io_err != NULL)
- io_remove(&ctx->io_err);
+ io_remove(&ctx->io_err);
break;
default:
while ((line = i_stream_next_line(ctx->err_stream)) != NULL)
} else {
i_assert(ctx->err_stream == NULL);
}
- if (ctx->io_err != NULL)
- io_remove(&ctx->io_err);
+ io_remove(&ctx->io_err);
i_close_fd(&ctx->fd_err);
if (ctx->child_wait != NULL)
}
timeout_remove(&ibc->to);
- if (ibc->io != NULL)
- io_remove(&ibc->io);
+ io_remove(&ibc->io);
i_stream_destroy(&ibc->input);
o_stream_destroy(&ibc->output);
pool_unref(&ibc->ret_pool);
o_stream_destroy(&conn->cmd_output);
if (conn->ssl_iostream != NULL)
ssl_iostream_unref(&conn->ssl_iostream);
- if (conn->io != NULL)
- io_remove(&conn->io);
+ io_remove(&conn->io);
if (conn->fd != -1) {
if (close(conn->fd) < 0)
i_error("close(server) failed: %m");
conn->input = NULL;
conn->output = NULL;
conn->ssl_iostream = NULL;
- if (conn->io != NULL)
- io_remove(&conn->io);
+ io_remove(&conn->io);
conn->fd = -1;
}
if (client->unhibernate_queued)
priorityq_remove(unhibernate_queue, &client->item);
- if (client->io != NULL)
- io_remove(&client->io);
+ io_remove(&client->io);
if (client->to_keepalive != NULL)
timeout_remove(&client->to_keepalive);
array_foreach_modifiable(&client->notifys, notify) {
- if (notify->io != NULL)
- io_remove(¬ify->io);
+ io_remove(¬ify->io);
i_close_fd(¬ify->fd);
}
}
{
client->worker_state = IMAP_URLAUTH_WORKER_STATE_INACTIVE;
- if (client->ctrl_io != NULL)
- io_remove(&client->ctrl_io);
+ io_remove(&client->ctrl_io);
if (client->ctrl_output != NULL)
o_stream_destroy(&client->ctrl_output);
if (client->ctrl_input != NULL)
if (client->mail_user != NULL)
mail_user_unref(&client->mail_user);
- if (client->io != NULL)
- io_remove(&client->io);
- if (client->ctrl_io != NULL)
- io_remove(&client->ctrl_io);
+ io_remove(&client->io);
+ io_remove(&client->ctrl_io);
if (client->to_idle != NULL)
timeout_remove(&client->to_idle);
i_assert(ctx->client->input_lock == ctx->cmd);
- if (ctx->client->io != NULL)
- io_remove(&ctx->client->io);
+ io_remove(&ctx->client->io);
/* we must put back the original flush callback before beginning to
sync (the command is still unfinished at that point) */
o_stream_set_flush_callback(ctx->client->output,
}
o_stream_cork(client->output);
- if (client->io != NULL)
- io_remove(&client->io);
+ io_remove(&client->io);
if (client->mailbox != NULL)
mailbox_notify_changes_stop(client->mailbox);
if (client->free_parser != NULL)
imap_parser_unref(&client->free_parser);
- if (client->io != NULL)
- io_remove(&client->io);
+ io_remove(&client->io);
if (client->to_idle_output != NULL)
timeout_remove(&client->to_idle_output);
if (client->to_delayed_input != NULL)
*_client = NULL;
DLLIST_REMOVE(&clients, client);
- if (client->io != NULL)
- io_remove(&client->io);
+ io_remove(&client->io);
i_stream_destroy(&client->input);
o_stream_destroy(&client->output);
if (close(client->fd) < 0)
if (conn->to != NULL)
timeout_remove(&conn->to);
- if (conn->io != NULL)
- io_remove(&conn->io);
+ io_remove(&conn->io);
if (conn->fd != -1) {
i_stream_destroy(&conn->input);
o_stream_destroy(&conn->output);
if (client->to_idle != NULL)
timeout_remove(&client->to_idle);
- if (client->io != NULL)
- io_remove(&client->io);
+ io_remove(&client->io);
if (client->input != NULL)
i_stream_destroy(&client->input);
if (client->fd != -1) {
if (conn->connect_initialized)
connection_disconnect(&conn->conn);
- if (conn->io_req_payload != NULL)
- io_remove(&conn->io_req_payload);
+ io_remove(&conn->io_req_payload);
if (conn->to_requests != NULL)
timeout_remove(&conn->to_requests);
if (conn->to_connect != NULL)
{
struct http_client_connection *conn = req->conn;
- if (conn->io_req_payload != NULL)
- io_remove(&conn->io_req_payload);
+ io_remove(&conn->io_req_payload);
(void)http_client_connection_output(conn);
}
i_assert(req->payload_input != NULL);
i_assert(req->payload_output != NULL);
- if (conn->io_req_payload != NULL)
- io_remove(&conn->io_req_payload);
+ io_remove(&conn->io_req_payload);
/* chunked ostream needs to write to the parent stream's buffer */
o_stream_set_max_buffer_size(output, IO_BLOCK_SIZE);
static void
http_server_connection_input_halt(struct http_server_connection *conn)
{
- if (conn->conn.io != NULL)
- io_remove(&conn->conn.io);
+ io_remove(&conn->conn.io);
}
static void
timeout_remove(&conn->to_input);
http_server_connection_timeout_stop(conn);
- if (conn->io_resp_payload != NULL)
- io_remove(&conn->io_resp_payload);
+ io_remove(&conn->io_resp_payload);
if (conn->conn.output != NULL) {
o_stream_nflush(conn->conn.output);
o_stream_uncork(conn->conn.output);
{
struct http_server_connection *conn = resp->request->conn;
- if (conn->io_resp_payload != NULL)
- io_remove(&conn->io_resp_payload);
+ io_remove(&conn->io_resp_payload);
(void)http_server_connection_output(conn);
}
i_assert(resp->payload_input != NULL);
i_assert(resp->payload_output != NULL);
- if (conn->io_resp_payload != NULL)
- io_remove(&conn->io_resp_payload);
+ io_remove(&conn->io_resp_payload);
/* chunked ostream needs to write to the parent stream's buffer */
o_stream_set_max_buffer_size(output, IO_BLOCK_SIZE);
static void
test_client_request_destroy(struct test_client_request *tcreq)
{
- if (tcreq->io != NULL)
- io_remove(&tcreq->io);
+ io_remove(&tcreq->io);
if (tcreq->payload != NULL)
i_stream_unref(&tcreq->payload);
if (tcreq->file != NULL)
test_server_hanging_request_payload_destroyed(struct _hanging_request_payload *ctx)
{
test_assert(!ctx->serviced);
- if (ctx->io != NULL)
- io_remove(&ctx->io);
+ io_remove(&ctx->io);
i_free(ctx);
io_loop_stop(ioloop);
}
test_server_hanging_response_payload_destroyed(struct _hanging_response_payload *ctx)
{
test_assert(!ctx->serviced);
- if (ctx->io != NULL)
- io_remove(&ctx->io);
+ io_remove(&ctx->io);
i_free(ctx);
io_loop_stop(ioloop);
}
timeout_remove(&conn->to_throttle_shrink);
if (conn->parser != NULL)
imap_parser_unref(&conn->parser);
- if (conn->io != NULL)
- io_remove(&conn->io);
+ io_remove(&conn->io);
if (conn->ssl_iostream != NULL)
ssl_iostream_unref(&conn->ssl_iostream);
if (conn->fd != -1) {
struct ip_addr local_ip;
in_port_t local_port;
int err;
- if (conn->io != NULL)
- io_remove(&conn->io);
+ io_remove(&conn->io);
err = net_geterror(conn->fd);
if (err != 0) {
if (conn->to != NULL)
timeout_remove(&conn->to);
- if (conn->io != NULL)
- io_remove(&conn->io);
+ io_remove(&conn->io);
if (conn->fd != -1) {
if (close(conn->fd) < 0)
i_fatal("close(%s) failed: %m", conn->path);
if (auth->to != NULL)
timeout_remove(&auth->to);
- if (auth->io != NULL)
- io_remove(&auth->io);
+ io_remove(&auth->io);
if (auth->fd != -1) {
if (auth->input != NULL)
i_stream_destroy(&auth->input);
DLLIST_REMOVE(&conn->login->conns, conn);
- if (conn->io != NULL)
- io_remove(&conn->io);
+ io_remove(&conn->io);
o_stream_close(conn->output);
if (close(conn->fd) < 0)
i_error("close(master login) failed: %m");
DLLIST_REMOVE(&service->haproxy_conns, hpconn);
- if (hpconn->io != NULL)
- io_remove(&hpconn->io);
+ io_remove(&hpconn->io);
if (hpconn->to != NULL)
timeout_remove(&hpconn->to);
i_free(hpconn);
timeout_remove(&service->to_overflow_state);
if (service->to_status != NULL)
timeout_remove(&service->to_status);
- if (service->io_status_error != NULL)
- io_remove(&service->io_status_error);
- if (service->io_status_write != NULL)
- io_remove(&service->io_status_write);
+ io_remove(&service->io_status_error);
+ io_remove(&service->io_status_write);
if (array_is_created(&service->config_overrides))
array_free(&service->config_overrides);
unsigned int i;
for (i = 0; i < service->socket_count; i++) {
- if (service->listeners[i].io != NULL)
- io_remove(&service->listeners[i].io);
+ io_remove(&service->listeners[i].io);
}
}
sizeof(service->master_status));
if (ret == sizeof(service->master_status)) {
/* success */
- if (service->io_status_write != NULL) {
- /* delayed important update sent successfully */
- io_remove(&service->io_status_write);
- }
+ io_remove(&service->io_status_write);
service->last_sent_status_time = ioloop_time;
service->last_sent_status_avail_count =
service->master_status.available_count;
for(i = 0; i < count; i++) {
if (efds[i].input != NULL)
i_stream_unref(&efds[i].input);
- if (efds[i].io != NULL)
- io_remove(&efds[i].io);
+ io_remove(&efds[i].io);
if (efds[i].parent_fd != -1 && close(efds[i].parent_fd) < 0)
i_error("close(fd=%d) failed: %m", efds[i].parent_fd);
}
if (pclient->program_output != NULL)
o_stream_destroy(&pclient->program_output);
- if (pclient->io != NULL)
- io_remove(&pclient->io);
+ io_remove(&pclient->io);
if (pclient->fd_in != -1 && close(pclient->fd_in) < 0)
i_error("close(%s) failed: %m", pclient->path);
if (pclient->to != NULL)
timeout_remove(&pclient->to);
- if (pclient->io != NULL)
- io_remove(&pclient->io);
+ io_remove(&pclient->io);
if ((ret = program_client_close_output(pclient)) < 0)
pclient->other_error = TRUE;
if (pclient->seekable_output != NULL)
i_stream_unref(&pclient->seekable_output);
- if (pclient->io != NULL)
- io_remove(&pclient->io);
+ io_remove(&pclient->io);
i_free(pclient->temp_prefix);
if (pclient->destroy != NULL)
if (o_stream_nfinish(client->out) != 0)
i_error("output error: %s", o_stream_get_error(client->out));
- if (client->io != NULL)
- io_remove(&client->io);
+ io_remove(&client->io);
o_stream_unref(&client->out);
i_stream_unref(&client->in);
if (client->os_body != NULL)
if (o_stream_nfinish(client->out) != 0)
i_error("output error: %s", o_stream_get_error(client->out));
- if (client->io != NULL)
- io_remove(&client->io);
+ io_remove(&client->io);
o_stream_unref(&client->out);
i_stream_unref(&client->in);
if (client->os_body != NULL)
dns_lookup_abort(&client->dns_lookup);
if (client->to != NULL)
timeout_remove(&client->to);
- if (client->io != NULL)
- io_remove(&client->io);
+ io_remove(&client->io);
if (client->input != NULL)
i_stream_close(client->input);
if (client->output != NULL)
struct cassandra_sql_prepared_statement *const *prep_stmtp;
struct cassandra_result *const *resultp;
- if (db->io_pipe != NULL)
- io_remove(&db->io_pipe);
+ io_remove(&db->io_pipe);
if (db->fd_pipe[0] != -1) {
i_close_fd(&db->fd_pipe[0]);
i_close_fd(&db->fd_pipe[1]);
dns_lookup_abort(&client->dns_lookup);
if (client->to != NULL)
timeout_remove(&client->to);
- if (client->io != NULL)
- io_remove(&client->io);
+ io_remove(&client->io);
if (client->input != NULL)
i_stream_destroy(&client->input);
if (client->output != NULL)
mailbox_free(&inotify->inbox);
if (inotify->subscriptions != NULL)
mailbox_tree_deinit(&inotify->subscriptions);
- if (inotify->io_wait != NULL)
- io_remove(&inotify->io_wait);
- if (inotify->io_wait_inbox != NULL)
- io_remove(&inotify->io_wait_inbox);
+ 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)
inotify->wait_context = context;
if (callback == NULL) {
- if (inotify->io_wait != NULL)
- io_remove(&inotify->io_wait);
- if (inotify->io_wait_inbox != NULL)
- io_remove(&inotify->io_wait_inbox);
+ 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)
file = box->notify_files;
box->notify_files = file->next;
- if (file->io_notify != NULL)
- io_remove(&file->io_notify);
+ io_remove(&file->io_notify);
i_free(file->path);
i_free(file);
}
i_zero(&conn->last_input_tv);
if (conn->to != NULL)
timeout_remove(&conn->to);
- if (conn->io != NULL)
- io_remove(&conn->io);
+ io_remove(&conn->io);
if (conn->input != NULL) {
i_stream_close(conn->input);
i_stream_destroy(&conn->input);
}
for (io = ctx->fd_ctx.notifies; io != NULL; io = io->next)
io->fd = -1;
- if (ctx->event_io != NULL)
- io_remove(&ctx->event_io);
+ io_remove(&ctx->event_io);
fd = ctx->inotify_fd;
ctx->inotify_fd = new_inotify_fd;
return fd;
io_remove(&_io);
}
- if (ctx->event_io)
- io_remove(&ctx->event_io);
+ io_remove(&ctx->event_io);
if (close(ctx->kq) < 0)
i_error("close(kqueue notify) failed: %m");
i_free(ctx);
}
for (io = ctx->notifies; io != NULL; io = io->next)
io->fd = -1;
- if (ctx->event_io != NULL)
- io_remove(&ctx->event_io);
+ io_remove(&ctx->event_io);
fd = ctx->kq;
ctx->kq = new_kq;
return fd;
o_stream_unset_flush_callback(pump->output);
- if (pump->io != NULL)
- io_remove(&pump->io);
+ io_remove(&pump->io);
}
void iostream_pump_switch_ioloop(struct iostream_pump *pump)
static void stream_closed(struct file_ostream *fstream)
{
- if (fstream->io != NULL)
- io_remove(&fstream->io);
+ io_remove(&fstream->io);
if (fstream->autoclose_fd && fstream->fd != -1) {
if (close(fstream->fd) < 0) {
fstream->flush_pending = TRUE;
if (!fstream->flush_pending && IS_STREAM_EMPTY(fstream)) {
- if (fstream->io != NULL) {
- /* all sent */
- io_remove(&fstream->io);
- }
+ io_remove(&fstream->io);
} else if (!fstream->ostream.ostream.closed) {
/* Add the IO handler if it's not there already. Callback
might have just returned 0 without there being any data
void client_io_reset(struct client *client)
{
- if (client->io != NULL)
- io_remove(&client->io);
+ io_remove(&client->io);
if (client->to_idle != NULL)
timeout_remove(&client->to_idle);
client->io = io_add(client->fd_in, IO_READ, client_input, client);
mail_user_unref(&client->raw_mail_user);
if (client->proxy != NULL)
lmtp_proxy_deinit(&client->proxy);
- if (client->io != NULL)
- io_remove(&client->io);
+ io_remove(&client->io);
if (client->to_idle != NULL)
timeout_remove(&client->to_idle);
if (client->ssl_iostream != NULL)
}
i_stream_unref(&log->input);
- if (log->io != NULL)
- io_remove(&log->io);
+ io_remove(&log->io);
if (close(log->fd) < 0)
i_error("close(log connection fd) failed: %m");
i_free(log->default_prefix);
if (client->auth_initializing || client->destroyed)
return;
- if (client->io != NULL)
- io_remove(&client->io);
+ io_remove(&client->io);
client->io = io_add(client->fd, IO_READ, client_input, client);
client_input(client);
client->proxy_not_trusted = reply->proxy_not_trusted;
/* disable input until authentication is finished */
- if (client->io != NULL)
- io_remove(&client->io);
+ io_remove(&client->io);
return 0;
}
return 1;
/* don't handle input until we get the initial auth reply */
- if (client->io != NULL)
- io_remove(&client->io);
+ io_remove(&client->io);
client_set_auth_waiting(client);
return 0;
}
i_assert(!client->authenticating);
}
- if (client->io != NULL)
- io_remove(&client->io);
+ io_remove(&client->io);
if (client->to_disconnect != NULL)
timeout_remove(&client->to_disconnect);
if (client->to_auth_waiting != NULL)
/* remove input handler, SSL proxy gives us a new fd. we also have to
remove it in case we have to wait for buffer to be flushed */
- if (client->io != NULL)
- io_remove(&client->io);
+ io_remove(&client->io);
client->v.notify_starttls(client, TRUE, "Begin TLS negotiation now.");
proxy->state_rec->num_proxying_connections--;
}
- if (proxy->server_io != NULL)
- io_remove(&proxy->server_io);
+ io_remove(&proxy->server_io);
if (proxy->server_input != NULL)
i_stream_destroy(&proxy->server_input);
if (proxy->server_output != NULL)
timeout_remove(&proxy->to);
}
- if (proxy->client_io != NULL)
- io_remove(&proxy->client_io);
+ io_remove(&proxy->client_io);
if (proxy->client_input != NULL)
i_stream_destroy(&proxy->client_input);
if (proxy->client_output != NULL)
static void login_access_lookup_free(struct login_access_lookup *lookup)
{
- if (lookup->io != NULL)
- io_remove(&lookup->io);
+ io_remove(&lookup->io);
if (lookup->access != NULL)
access_lookup_destroy(&lookup->access);
if (lookup->conn.fd != -1) {
{
if (*lookup->next_socket == NULL) {
/* last one */
- if (lookup->io != NULL)
- io_remove(&lookup->io);
+ io_remove(&lookup->io);
client_connected_finish(&lookup->conn);
lookup->conn.fd = -1;
login_access_lookup_free(lookup);
ssl_step, proxy);
break;
case SSL_REMOVE_INPUT:
- if (proxy->io_ssl_read != NULL)
- io_remove(&proxy->io_ssl_read);
+ io_remove(&proxy->io_ssl_read);
break;
case SSL_ADD_OUTPUT:
if (proxy->io_ssl_write != NULL)
ssl_step, proxy);
break;
case SSL_REMOVE_OUTPUT:
- if (proxy->io_ssl_write != NULL)
- io_remove(&proxy->io_ssl_write);
+ io_remove(&proxy->io_ssl_write);
break;
}
}
static void plain_block_input(struct ssl_proxy *proxy, bool block)
{
if (block) {
- if (proxy->io_plain_read != NULL)
- io_remove(&proxy->io_plain_read);
+ io_remove(&proxy->io_plain_read);
} else {
if (proxy->io_plain_read == NULL) {
proxy->io_plain_read = io_add(proxy->fd_plain, IO_READ,
plain_write, proxy);
}
} else {
- if (proxy->io_plain_write != NULL)
- io_remove(&proxy->io_plain_write);
+ io_remove(&proxy->io_plain_write);
}
ssl_set_io(proxy, SSL_ADD_INPUT);
ssl_proxy_count--;
DLLIST_REMOVE(&ssl_proxies, proxy);
- if (proxy->io_ssl_read != NULL)
- io_remove(&proxy->io_ssl_read);
- if (proxy->io_ssl_write != NULL)
- io_remove(&proxy->io_ssl_write);
- if (proxy->io_plain_read != NULL)
- io_remove(&proxy->io_plain_read);
- if (proxy->io_plain_write != NULL)
- io_remove(&proxy->io_plain_write);
+ io_remove(&proxy->io_ssl_read);
+ io_remove(&proxy->io_ssl_write);
+ io_remove(&proxy->io_plain_read);
+ io_remove(&proxy->io_plain_write);
if (SSL_shutdown(proxy->ssl) != 1) {
/* if bidirectional shutdown fails we need to clear
array_foreach(&service->listeners, listeners) {
struct service_listener *l = *listeners;
- if (l->io != NULL)
- io_remove(&l->io);
+ io_remove(&l->io);
}
service->listening = FALSE;
service->listen_pending = FALSE;
{
int i;
- if (service->io_status != NULL)
- io_remove(&service->io_status);
+ io_remove(&service->io_status);
if (service->status_fd[0] != -1 &&
service->type != SERVICE_TYPE_ANVIL) {
if (wait)
services_monitor_wait_and_kill(service_list);
- if (service_list->io_master != NULL)
- io_remove(&service_list->io_master);
+ io_remove(&service_list->io_master);
i_close_fd(&service_list->master_fd);
array_foreach(&service_list->services, services)
*_notify = NULL;
service_process_notify_reset(notify);
- if (notify->io_write != NULL)
- io_remove(¬ify->io_write);
+ io_remove(¬ify->io_write);
aqueue_deinit(¬ify->process_queue);
array_free(¬ify->processes);
i_free(notify);
timeout to ioloop unnecessarily */
if (parser->payload != NULL)
i_stream_unref(&parser->payload);
- if (parser->io != NULL)
- io_remove(&parser->io);
+ io_remove(&parser->io);
if (parser->http_req != NULL)
http_client_request_abort(&parser->http_req);
if (parser->ioloop != NULL) {
i_free(client->seen_bitmask);
i_free(client->msgnum_to_seq_map);
- if (client->io != NULL)
- io_remove(&client->io);
+ io_remove(&client->io);
timeout_remove(&client->to_idle);
if (client->to_commit != NULL)
timeout_remove(&client->to_commit);
*_client = NULL;
DLLIST_REMOVE(&clients, client);
- if (client->io != NULL)
- io_remove(&client->io);
+ io_remove(&client->io);
i_stream_destroy(&client->input);
o_stream_destroy(&client->output);
if (close(client->fd) < 0)
struct stats_send_ctx *ctx = *_ctx;
*_ctx = NULL;
- if (ctx->io != NULL)
- io_remove(&ctx->io);
+ io_remove(&ctx->io);
if (ctx->to != NULL)
timeout_remove(&ctx->to);
i_close_fd(&ctx->fd);
}
o_stream_destroy(&proxy->out_output);
}
- if (proxy->client_io != NULL)
- io_remove(&proxy->client_io);
- if (proxy->server_io != NULL)
- io_remove(&proxy->server_io);
+ io_remove(&proxy->client_io);
+ io_remove(&proxy->server_io);
if (proxy->to_flush != NULL)
timeout_remove(&proxy->to_flush);