X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fs_auth.c;h=83693a24a48125df9150291bdddfcaabc5c59e36;hb=d0a284c68368f5cd58309293e936f82e032f7ae8;hp=924bd50ab13dcc36df46936301348155a327312d;hpb=894ccd3b8d5acb0067562d26bf72228d3e617203;p=ircu2.10.12-pk.git diff --git a/ircd/s_auth.c b/ircd/s_auth.c index 924bd50..83693a2 100644 --- a/ircd/s_auth.c +++ b/ircd/s_auth.c @@ -679,6 +679,8 @@ static void read_auth_reply(struct AuthRequest* auth) 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); @@ -1373,19 +1375,19 @@ static void iauth_disconnect(struct IAuth *iauth) 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. */ @@ -2248,8 +2250,7 @@ static void iauth_sock_callback(struct Event *ev) 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: @@ -2322,7 +2323,8 @@ static void iauth_stderr_callback(struct Event *ev) 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);