X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;ds=sidebyside;f=src%2Fngircd%2Fparse.c;h=586b80d4c6d15f1b9f853be3103f77d0b85d8047;hb=4c6a99cf0b7b0d613eafc6ea7e19e1e10616fd4d;hp=cd3d95d4bdfc5bf8509037a225527f204fc73514;hpb=76c4f06680d6c74f527f33508f307d27f3bfb62d;p=ngircd-alex.git diff --git a/src/ngircd/parse.c b/src/ngircd/parse.c index cd3d95d4..586b80d4 100644 --- a/src/ngircd/parse.c +++ b/src/ngircd/parse.c @@ -9,11 +9,28 @@ * Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste * der an comBase beteiligten Autoren finden Sie in der Datei AUTHORS. * - * $Id: parse.c,v 1.2 2001/12/23 21:56:47 alex Exp $ + * $Id: parse.c,v 1.7 2001/12/27 19:13:21 alex Exp $ * * parse.c: Parsen der Client-Anfragen * * $Log: parse.c,v $ + * Revision 1.7 2001/12/27 19:13:21 alex + * - neue Befehle NOTICE und PRIVMSG. + * - Debug-Logging ein wenig reduziert. + * + * Revision 1.6 2001/12/26 14:45:37 alex + * - "Code Cleanups". + * + * Revision 1.5 2001/12/26 03:23:03 alex + * - PING/PONG-Befehle implementiert. + * + * Revision 1.4 2001/12/25 22:04:26 alex + * - Aenderungen an den Debug- und Logging-Funktionen. + * + * Revision 1.3 2001/12/25 19:18:36 alex + * - Gross- und Kleinschreibung der IRC-Befehle wird ignoriert. + * - bessere Debug-Ausgaben. + * * Revision 1.2 2001/12/23 21:56:47 alex * - bessere Debug-Ausgaben, * - Bug im Parameter-Parser behoben (bei "langem" Parameter) @@ -75,7 +92,7 @@ GLOBAL BOOLEAN Parse_Request( CONN_ID Idx, CHAR *Request ) assert( Idx >= 0 ); assert( Request != NULL ); -#ifdef DEBUG +#ifdef SNIFFER Log( LOG_DEBUG, " <- connection %d: '%s'.", Idx, Request ); #endif @@ -201,20 +218,24 @@ LOCAL BOOLEAN Handle_Request( CONN_ID Idx, REQUEST *Req ) assert( Req != NULL ); assert( Req->command != NULL ); -#ifdef DEBUG - Log( LOG_DEBUG, " connection %d: '%s', %d %s,%s prefix.", Idx, Req->command, Req->argc, Req->argc == 1 ? "parameter" : "parameters", Req->prefix ? "" : " no" ); -#endif - client = Client_GetFromConn( Idx ); assert( client != NULL ); - if( strcmp( Req->command, "PASS" ) == 0 ) return IRC_PASS( client, Req ); - else if( strcmp( Req->command, "NICK" ) == 0 ) return IRC_NICK( client, Req ); - else if( strcmp( Req->command, "USER" ) == 0 ) return IRC_USER( client, Req ); - + if( strcasecmp( Req->command, "PASS" ) == 0 ) return IRC_PASS( client, Req ); + else if( strcasecmp( Req->command, "NICK" ) == 0 ) return IRC_NICK( client, Req ); + else if( strcasecmp( Req->command, "USER" ) == 0 ) return IRC_USER( client, Req ); + else if( strcasecmp( Req->command, "QUIT" ) == 0 ) return IRC_QUIT( client, Req ); + else if( strcasecmp( Req->command, "PING" ) == 0 ) return IRC_PING( client, Req ); + else if( strcasecmp( Req->command, "PONG" ) == 0 ) return IRC_PONG( client, Req ); + else if( strcasecmp( Req->command, "MOTD" ) == 0 ) return IRC_MOTD( client, Req ); + else if( strcasecmp( Req->command, "PRIVMSG" ) == 0 ) return IRC_PRIVMSG( client, Req ); + else if( strcasecmp( Req->command, "NOTICE" ) == 0 ) return IRC_NOTICE( client, Req ); + /* Unbekannter Befehl */ - Conn_WriteStr( Idx, ERR_UNKNOWNCOMMAND_MSG, Req->command ); + IRC_WriteStrClient( client, This_Server, ERR_UNKNOWNCOMMAND_MSG, Client_Name( client ), Req->command ); + Log( LOG_DEBUG, "Connection %d: Unknown command '%s', %d %s,%s prefix.", Idx, Req->command, Req->argc, Req->argc == 1 ? "parameter" : "parameters", Req->prefix ? "" : " no" ); + return TRUE; } /* Handle_Request */