- switch (os_recv_nonb(s_fd(i_socket(iauth)), readbuf, sizeof(readbuf), &length))
- {
- case IO_SUCCESS: break;
- case IO_FAILURE: iauth_disconnect(iauth);
- case IO_BLOCKED: return;
- }
- iauth->i_recvB += length;
- old_buffer = iauth->i_buffer;
- endp = old_buffer + iauth->i_count;
- for (src = readbuf; length > 0; --length) {
- *endp = *src++;
- if (IsEol(*endp)) {
- /* Terminate line, reset buffer and update statistics. */
- *endp = '\0';
- endp = old_buffer;
- ++iauth->i_recvM;
-
- /* If spammy debug, send the message to opers. */
- if (i_debug(iauth) > 1)
- sendto_opmask_butone(NULL, SNO_AUTH, "%s", endp);
-
- /* Find command handler. A lot of the handlers would be simpler
- * with an argument splitter like in parse.c, but some commands
- * (notably '>') do not use delimiters that way.
- */
- switch (*(endp = old_buffer)) {
- case '>': handler = iauth_cmd_snotice; has_cli = 0; break;
- case 'G': handler = iauth_cmd_debuglevel; has_cli = 0; break;
- case 'O': handler = iauth_cmd_policy; has_cli = 0; break;
- case 'V': handler = iauth_cmd_version; has_cli = 0; break;
- case 'a': handler = iauth_cmd_newconfig; has_cli = 0; break;
- case 'A': handler = iauth_cmd_config; has_cli = 0; break;
- case 's': handler = iauth_cmd_newstats; has_cli = 0; break;
- case 'S': handler = iauth_cmd_stats; has_cli = 0; break;
- case 'o': handler = iauth_cmd_username_forced; has_cli = 1; break;
- case 'U': handler = iauth_cmd_username_good; has_cli = 1; break;
- case 'u': handler = iauth_cmd_username_bad; has_cli = 1; break;
- case 'N': handler = iauth_cmd_hostname; has_cli = 1; break;
- case 'I': handler = iauth_cmd_ip_address; has_cli = 1; break;
- case 'C': handler = iauth_cmd_challenge; has_cli = 1; break;
- case 'D': handler = iauth_cmd_done_client; has_cli = 1; break;
- case 'R': handler = iauth_cmd_done_account; has_cli = 1; break;
- case 'k': /* The 'k' command indicates the user should be booted
- * off without telling opers. There is no way to
- * signal that to exit_client(), so we fall through to
- * the case that we do implement.
- */
- case 'K': handler = iauth_cmd_kill; has_cli = 2; break;
- case 'r': /* we handle termination directly */ continue;
- default: sendto_iauth(NULL, "E Garbage :[%s]", endp); continue;
- }
+ /* Find command handler... */
+ switch (*(message++)) {
+ case '>': handler = iauth_cmd_snotice; has_cli = 0; break;
+ case 'G': handler = iauth_cmd_debuglevel; has_cli = 0; break;
+ case 'O': handler = iauth_cmd_policy; has_cli = 0; break;
+ case 'V': handler = iauth_cmd_version; has_cli = 0; break;
+ case 'a': handler = iauth_cmd_newconfig; has_cli = 0; break;
+ case 'A': handler = iauth_cmd_config; has_cli = 0; break;
+ case 's': handler = iauth_cmd_newstats; has_cli = 0; break;
+ case 'S': handler = iauth_cmd_stats; has_cli = 0; break;
+ case 'o': handler = iauth_cmd_username_forced; has_cli = 1; break;
+ case 'U': handler = iauth_cmd_username_good; has_cli = 1; break;
+ case 'u': handler = iauth_cmd_username_bad; has_cli = 1; break;
+ case 'N': handler = iauth_cmd_hostname; has_cli = 1; break;
+ case 'I': handler = iauth_cmd_ip_address; has_cli = 1; break;
+ case 'M': handler = iauth_cmd_usermode; has_cli = 1; break;
+ case 'C': handler = iauth_cmd_challenge; has_cli = 1; break;
+ case 'D': handler = iauth_cmd_done_client; has_cli = 1; break;
+ case 'R': handler = iauth_cmd_done_account; has_cli = 1; break;
+ case 'k': /* The 'k' command indicates the user should be booted
+ * off without telling opers. There is no way to
+ * signal that to exit_client(), so we fall through to
+ * the case that we do implement.
+ */
+ case 'K': handler = iauth_cmd_kill; has_cli = 2; break;
+ case 'r': /* we handle termination directly */ return;
+ default: sendto_iauth(NULL, "E Garbage :[%s]", message); return;
+ }