if (shutdown(client->fd, SHUT_RDWR) < 0 && errno != ENOTCONN)
i_error("shutdown() failed: %m");
- if (data == NULL)
- client_destroy_internal_failure(client);
- else {
+ if (data != NULL) {
/* e.g. mail_max_userip_connections is reached */
- client->no_extra_disconnect_reason = TRUE;
- client_destroy(client, data);
+ } else {
+ /* The error should have been logged already.
+ The client will only see a generic internal error. */
+ client_notify_disconnect(client, CLIENT_DISCONNECT_INTERNAL_ERROR,
+ "Internal login failure. "
+ "Refer to server log for more information.");
+ data = t_strdup_printf("Internal login failure (pid=%s id=%u)",
+ my_pid, client->master_auth_id);
}
+ client->no_extra_disconnect_reason = TRUE;
+ client_destroy(client, data);
break;
case SASL_SERVER_REPLY_CONTINUE:
i_assert(client->v.auth_send_challenge != NULL);
client_destroy(client, reason);
}
-void client_destroy_internal_failure(struct client *client)
-{
- client_notify_disconnect(client, CLIENT_DISCONNECT_INTERNAL_ERROR,
- "Internal login failure. "
- "Refer to server log for more information.");
- client_destroy(client, t_strdup_printf(
- "Internal login failure (pid=%s id=%u)",
- my_pid, client->master_auth_id));
-}
-
void client_ref(struct client *client)
{
client->refcount++;
void **other_sets);
void client_destroy(struct client *client, const char *reason);
void client_destroy_success(struct client *client, const char *reason);
-void client_destroy_internal_failure(struct client *client);
void client_ref(struct client *client);
bool client_unref(struct client **client) ATTR_NOWARN_UNUSED_RESULT;