ID is a connection-specific unique request identifier. It must be a 32bit
number, so typically you'd just increment it by one.
-NOTFOUND reply means that the request or user wasn't found. Master
-shouldn't even try to send REQUEST commands for nonexisting requests, so if
-it happens it means either a timeout caused by very high load, or client
-lying to master about the request.
+NOTFOUND reply means that the user wasn't found.
FAIL reply means an internal error occurred. Usually either a configuration
mistake or temporary error caused by lost resource (eg. database down).
+Also unknown request IDs are reported as FAILs.
USER reply is sent if request succeeded. It can return parameters:
i_error("Master requested auth for nonexisting client %u",
client_pid);
(void)o_stream_send_str(conn->output,
- t_strdup_printf("NOTFOUND\t%u\n", id));
+ t_strdup_printf("FAIL\t%u\n", id));
} else if (memcmp(client_conn->cookie, cookie, sizeof(cookie)) != 0) {
i_error("Master requested auth for client %u with invalid cookie",
client_pid);
(void)o_stream_send_str(conn->output,
- t_strdup_printf("NOTFOUND\t%u\n", id));
+ t_strdup_printf("FAIL\t%u\n", id));
} else {
auth_request_handler_master_request(
client_conn->request_handler, conn, id, client_id);
if (request == NULL) {
i_error("Master request %u.%u not found",
handler->client_pid, client_id);
- auth_stream_reply_add(reply, "NOTFOUND", NULL);
+ auth_stream_reply_add(reply, "FAIL", NULL);
auth_stream_reply_add(reply, NULL, dec2str(id));
handler->master_callback(reply, master);
return;
!request->successful) {
i_error("Master requested unfinished authentication request "
"%u.%u", handler->client_pid, client_id);
- auth_stream_reply_add(reply, "NOTFOUND", NULL);
+ auth_stream_reply_add(reply, "FAIL", NULL);
auth_stream_reply_add(reply, NULL, dec2str(id));
handler->master_callback(reply, master);
auth_request_unref(&request);
id = (unsigned int)strtoul(args, NULL, 10);
request = master_login_auth_lookup_request(auth, id);
if (request != NULL) {
- i_error("Auth request not found (timed out?): %u", id);
+ i_error("Authenticated user not found from userdb");
request->callback(NULL, request->context);
i_free(request);
}
id = (unsigned int)strtoul(args, NULL, 10);
request = master_login_auth_lookup_request(auth, id);
if (request != NULL) {
+ i_error("Internal auth failure");
request->callback(NULL, request->context);
i_free(request);
}