/* send the fd first */
ret = fd_send(o_stream_get_fd(output), client->fd, str_data(str), 1);
if (ret < 0) {
- i_error("fd_send(%s) failed: %m",
+ e_error(client->event, "fd_send(%s) failed: %m",
o_stream_get_name(output));
imap_client_destroy(&client, "Failed to recreate imap process");
return;
return TRUE;
} else if (ret < 0) {
/* failed to connect to the imap-master socket */
- i_error("Failed to unhibernate client: %s", error);
+ e_error(client->event, "Failed to unhibernate client: %s", error);
imap_client_destroy(&client, error);
return TRUE;
}
if (var_expand_with_funcs(str, state->mail_log_prefix,
imap_client_get_var_expand_table(client),
funcs, fields, &error) <= 0) {
- i_error("Failed to expand mail_log_prefix=%s: %s",
+ e_error(client->event,
+ "Failed to expand mail_log_prefix=%s: %s",
state->mail_log_prefix, error);
}
client->log_prefix = p_strdup(pool, str_c(str));
if (reason != NULL) {
/* the client input/output bytes don't count the DONE+IDLE by
imap-hibernate, but that shouldn't matter much. */
- i_info("%s %s", reason, client->state.stats);
+ e_info(client->event, "%s %s", reason, client->state.stats);
}
if (client->state.anvil_sent) {
const char *error;
if (imap_hibernate_client_parse_input(args, pool, &state, &error) < 0) {
- i_error("Failed to parse client input: %s", error);
+ e_error(conn->event, "Failed to parse client input: %s", error);
o_stream_nsend_str(conn->output, t_strdup_printf(
"-Failed to parse client input: %s\n", error));
return -1;
return 1;
}
if (client->finished) {
- i_error("Received unexpected line: %s", line);
+ e_error(conn->event, "Received unexpected line: %s", line);
return -1;
}
fd = i_stream_unix_get_read_fd(conn->input);
if (fd == -1) {
- i_error("IMAP client fd not received");
+ e_error(conn->event, "IMAP client fd not received");
return -1;
}
args = p_strsplit_tabescaped(pool, line);
ret = imap_hibernate_client_input_args(conn, (void *)args, fd, pool);
if (ret >= 0 && client->debug)
- i_debug("Create client with input: %s", line);
+ e_debug(conn->event, "Create client with input: %s", line);
pool_unref(&pool);
} else {
fd = i_stream_unix_get_read_fd(conn->input);
if (fd == -1) {
- i_error("IMAP notify fd not received (input: %s)", line);
+ e_error(conn->event,
+ "IMAP notify fd not received (input: %s)", line);
ret = -1;
} else if (line[0] != '\0') {
- i_error("Expected empty notify fd line from client, but got: %s", line);
+ e_error(conn->event,
+ "Expected empty notify fd line from client, but got: %s", line);
o_stream_nsend_str(conn->output,
"Expected empty notify fd line");
ret = -1;
static void imap_master_connection_timeout(struct imap_master_connection *conn)
{
- i_error("Timeout communicating with %s (version %sreceived)",
+ e_error(conn->conn.event,
+ "Timeout communicating with %s (version %sreceived)",
conn->conn.name, conn->conn.version_received ? "" : "not ");
imap_master_connection_deinit(&conn);
}