/* Can this ever happen? */
case ACR_BAD_SOCKET:
++ServerStats->is_ref;
- IPcheck_connect_fail(cptr);
+ IPcheck_connect_fail(cptr, 0);
return exit_client(cptr, cptr, &me, "Unknown error -- Try again");
}
return 0;
if (IsUserPort(auth->client))
sendheader(auth->client, REPORT_FAIL_ID);
++ServerStats->is_abad;
+ if (IAuthHas(iauth, IAUTH_UNDERNET))
+ sendto_iauth(auth->client, "u");
} else {
if (IsUserPort(auth->client))
sendheader(auth->client, REPORT_FIN_ID);
if (iauth == NULL)
return;
- /* Close main socket. */
- if (s_fd(i_socket(iauth)) != -1) {
- close(s_fd(i_socket(iauth)));
- socket_del(i_socket(iauth));
- s_fd(i_socket(iauth)) = -1;
- }
-
/* Close error socket. */
if (s_fd(i_stderr(iauth)) != -1) {
close(s_fd(i_stderr(iauth)));
socket_del(i_stderr(iauth));
s_fd(i_stderr(iauth)) = -1;
}
+
+ /* Close main socket. */
+ if (s_fd(i_socket(iauth)) != -1) {
+ close(s_fd(i_socket(iauth)));
+ socket_del(i_socket(iauth));
+ s_fd(i_socket(iauth)) = -1;
+ }
}
/** Close all %IAuth connections marked as closing. */
memcpy(&auth->original, &cli_ip(cli), sizeof(auth->original));
/* Undo original IP connection in IPcheck. */
- IPcheck_connect_fail(cli);
+ IPcheck_connect_fail(cli, 1);
ClearIPChecked(cli);
/* Update the IP and charge them as a remote connect. */
switch (ev_type(ev)) {
case ET_DESTROY:
- /* Hm, what happened here? */
- if (!IAuthHas(iauth, IAUTH_CLOSING))
+ if (!IAuthHas(iauth, IAUTH_CLOSING) && !s_active(i_stderr(iauth)))
iauth_do_spawn(iauth, 1);
break;
case ET_READ:
switch (ev_type(ev)) {
case ET_DESTROY:
- /* We do not restart iauth here: the stdout handler does that for us. */
+ if (!IAuthHas(iauth, IAUTH_CLOSING) && !s_active(i_socket(iauth)))
+ iauth_do_spawn(iauth, 1);
break;
case ET_READ:
iauth_read_stderr(iauth);