/* Post-authentication, asking for capabilities */
POP3C_CLIENT_STATE_CAPA,
/* Authenticated, ready to accept commands */
- POP3C_CLIENT_STATE_DONE
+ POP3C_CLIENT_STATE_DONE,
+
+ POP3C_CLIENT_STATE_COUNT
+};
+static const char *pop3c_client_state_names[] = {
+ "disconnected",
+ "connecting",
+ "starttls",
+ "USER",
+ "AUTH",
+ "PASS",
+ "CAPA",
+ "authenticated",
};
+static_assert_array_size(pop3c_client_state_names, POP3C_CLIENT_STATE_COUNT);
struct pop3c_client_sync_cmd_ctx {
enum pop3c_command_state state;
break;
default:
e_error(client->event,
- "Authentication timed out after %u seconds",
+ "Timed out in state %s after %u seconds",
+ pop3c_client_state_names[client->state],
POP3C_CONNECT_TIMEOUT_MSECS/1000);
break;
}
break;
case POP3C_CLIENT_STATE_DISCONNECTED:
case POP3C_CLIENT_STATE_DONE:
+ case POP3C_CLIENT_STATE_COUNT:
i_unreached();
}
return 0;