value_len = strlen(value.value);
else if (value.value_stream != NULL) {
if (i_stream_get_size(value.value_stream, TRUE, &value_len) < 0) {
- i_error("GETMETADATA %s: i_stream_get_size(%s) failed: %s", entry,
+ e_error(client->event,
+ "GETMETADATA %s: i_stream_get_size(%s) failed: %s", entry,
i_stream_get_name(value.value_stream),
i_stream_get_error(value.value_stream));
i_stream_unref(&value.value_stream);
case OSTREAM_SEND_ISTREAM_RESULT_WAIT_OUTPUT:
return FALSE;
case OSTREAM_SEND_ISTREAM_RESULT_ERROR_INPUT:
- i_error("read(%s) failed: %s",
+ e_error(ctx->cmd->client->event, "read(%s) failed: %s",
i_stream_get_name(ctx->cur_stream),
i_stream_get_error(ctx->cur_stream));
client_disconnect(ctx->cmd->client,
case OSTREAM_SEND_ISTREAM_RESULT_WAIT_OUTPUT:
return 0;
case OSTREAM_SEND_ISTREAM_RESULT_ERROR_INPUT:
- i_error("read(%s) failed: %s (URLFETCH)",
+ e_error(client->event, "read(%s) failed: %s (URLFETCH)",
i_stream_get_name(ctx->input),
i_stream_get_error(ctx->input));
client_disconnect(client, "URLFETCH failed");
"/"IMAP_HIBERNATE_SOCKET_NAME, NULL);
fd = net_connect_unix_with_retries(path, 1000);
if (fd == -1) {
- i_error("net_connect_unix(%s) failed: %m", path);
+ e_error(client->event, "net_connect_unix(%s) failed: %m", path);
return -1;
}
net_set_nonblock(fd, FALSE);
state = buffer_create_dynamic(default_pool, 1024);
ret = imap_state_export_internal(client, state, &error);
if (ret < 0) {
- i_error("Couldn't hibernate imap client: "
+ e_error(client->event, "Couldn't hibernate imap client: "
"Couldn't export state: %s (mailbox=%s)", error,
client->mailbox == NULL ? "" :
mailbox_get_vname(client->mailbox));
if (ret > 0) {
if (imap_hibernate_process_send(client, state, fd_notify,
&fd_hibernate, &error) < 0) {
- i_error("Couldn't hibernate imap client: %s", error);
+ e_error(client->event,
+ "Couldn't hibernate imap client: %s", error);
ret = -1;
}
}
if (var_expand_with_funcs(str, client->set->imap_logout_format,
tab, mail_user_var_expand_func_table,
client->user, &error) < 0) {
- i_error("Failed to expand imap_logout_format=%s: %s",
+ e_error(client->event,
+ "Failed to expand imap_logout_format=%s: %s",
client->set->imap_logout_format, error);
}
return str_c(str);
client->imap_client_created = TRUE;
if (client_create_finish(imap_client, &error) < 0) {
- i_error("imap-master(%s): %s", input.username, error);
+ e_error(imap_client->event, "imap-master(%s): %s",
+ input.username, error);
client_destroy(imap_client, error);
return -1;
}
!i_stream_add_data(imap_client->input,
master_input.client_input->data,
master_input.client_input->used)) {
- i_error("imap-master: Couldn't add %zu bytes to client's input stream",
+ e_error(imap_client->event,
+ "imap-master: Couldn't add %zu bytes to client's input stream",
master_input.client_input->used);
client_destroy(imap_client, "Client initialization failed");
return -1;
ret = imap_state_import_internal(imap_client, master_input.state->data,
master_input.state->used, &error);
if (ret <= 0) {
- i_error("imap-master: Failed to import client state: %s", error);
+ e_error(imap_client->event,
+ "imap-master: Failed to import client state: %s", error);
client_destroy(imap_client, "Client state initialization failed");
return -1;
}
if (write_full(login_client->fd, MSG_BYE_INTERNAL_ERROR,
strlen(MSG_BYE_INTERNAL_ERROR)) < 0)
if (errno != EAGAIN && errno != EPIPE)
- i_error("write_full(client) failed: %m");
+ e_error(client->event,
+ "write_full(client) failed: %m");
- i_error("%s", error);
+ e_error(client->event, "%s", error);
client_destroy(client, error);
return;
}