Module: ngircd.git Branch: master Commit: 38747b40dcadd320220bb050974d5e5860a8ecbb URL: http://ngircd.barton.de/cgi-bin/gitweb.cgi?p=ngircd.git&a=commit;h=38747...
Author: Alexander Barton alex@barton.de Date: Wed Mar 16 23:58:39 2011 +0100
Don't use IRC_QUIT_HTTP() if STRICT_RFC is #define'd
---
src/ngircd/irc-login.c | 14 ++++++++++++++ src/ngircd/parse.c | 6 ++++-- 2 files changed, 18 insertions(+), 2 deletions(-)
diff --git a/src/ngircd/irc-login.c b/src/ngircd/irc-login.c index 7e75217..92d54ab 100644 --- a/src/ngircd/irc-login.c +++ b/src/ngircd/irc-login.c @@ -683,6 +683,18 @@ 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 ) { @@ -691,6 +703,8 @@ IRC_QUIT_HTTP( CLIENT *Client, REQUEST *Req ) return IRC_QUIT(Client, Req); } /* IRC_QUIT_HTTP */
+#endif +
/** * Handler for the IRC "PING" command. diff --git a/src/ngircd/parse.c b/src/ngircd/parse.c index 51149da..11bb3d1 100644 --- a/src/ngircd/parse.c +++ b/src/ngircd/parse.c @@ -85,8 +85,6 @@ static COMMAND My_Commands[] = { "PONG", IRC_PONG, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 }, { "PRIVMSG", IRC_PRIVMSG, CLIENT_USER|CLIENT_SERVER, 0, 0, 0 }, { "QUIT", IRC_QUIT, 0xFFFF, 0, 0, 0 }, - { "GET", IRC_QUIT_HTTP, 0xFFFF, 0, 0, 0 }, - { "POST", IRC_QUIT_HTTP, 0xFFFF, 0, 0, 0 }, { "REHASH", IRC_REHASH, CLIENT_USER, 0, 0, 0 }, { "RESTART", IRC_RESTART, CLIENT_USER, 0, 0, 0 }, { "SERVER", IRC_SERVER, 0xFFFF, 0, 0, 0 }, @@ -111,6 +109,10 @@ static COMMAND My_Commands[] = #ifdef IRCPLUS { "CHANINFO", IRC_CHANINFO, CLIENT_SERVER, 0, 0, 0 }, #endif +#ifndef STRICT_RFC + { "GET", IRC_QUIT_HTTP, 0xFFFF, 0, 0, 0 }, + { "POST", IRC_QUIT_HTTP, 0xFFFF, 0, 0, 0 }, +#endif { NULL, NULL, 0x0, 0, 0, 0 } /* Ende-Marke */ };