X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Fngircd%2Firc-login.c;h=92d54ab15e42ad64d2e7d05bd605bccc1cd7f734;hp=1557f1845fe8e3657949f45e1c386062cdaa7661;hb=fa8b83e69b0d7edcfdcf8f0a4496c79f9c5ec161;hpb=53fecf5a2b3e0f396b08b2a00a73eb73c46e1853 diff --git a/src/ngircd/irc-login.c b/src/ngircd/irc-login.c index 1557f184..92d54ab1 100644 --- a/src/ngircd/irc-login.c +++ b/src/ngircd/irc-login.c @@ -596,8 +596,14 @@ IRC_SERVICE(CLIENT *Client, REQUEST *Req) /** - * Handler for the IRC command "WEBIRC". - * Syntax: WEBIRC + * Handler for the IRC "WEBIRC" command. + * + * See doc/Protocol.txt, section II.4: + * "Update webchat/proxy client information". + * + * @param Client The client from which this command has been received. + * @param Req Request structure with prefix and all parameters. + * @returns CONNECTED or DISCONNECTED. */ GLOBAL bool IRC_WEBIRC(CLIENT *Client, REQUEST *Req) @@ -677,6 +683,29 @@ IRC_QUIT( CLIENT *Client, REQUEST *Req ) } /* IRC_QUIT */ +#ifndef STRICT_RFC + +/** + * Handler for HTTP command, e.g. GET and POST + * + * We handle these commands here to avoid the quite long timeout when + * some user tries to access this IRC daemon using an web browser ... + * + * @param Client The client from which this command has been received. + * @param Req Request structure with prefix and all parameters. + * @returns CONNECTED or DISCONNECTED. + */ +GLOBAL bool +IRC_QUIT_HTTP( CLIENT *Client, REQUEST *Req ) +{ + Req->argc = 1; + Req->argv[0] = "Oops, HTTP request received? This is IRC!"; + return IRC_QUIT(Client, Req); +} /* IRC_QUIT_HTTP */ + +#endif + + /** * Handler for the IRC "PING" command. * @@ -867,7 +896,9 @@ Hello_User(CLIENT * Client) /* Sub process */ Log_Init_Subprocess("Auth"); result = PAM_Authenticate(Client); - write(pipefd[1], &result, sizeof(result)); + if (write(pipefd[1], &result, sizeof(result)) != sizeof(result)) + Log_Subprocess(LOG_ERR, + "Failed to pipe result to parent!"); Log_Exit_Subprocess("Auth"); exit(0); }