* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
*
- * $Id: parse.c,v 1.18 2002/01/07 15:29:11 alex Exp $
+ * $Id: parse.c,v 1.21 2002/01/18 11:12:11 alex Exp $
*
* parse.c: Parsen der Client-Anfragen
*
* $Log: parse.c,v $
+ * Revision 1.21 2002/01/18 11:12:11 alex
+ * - der Sniffer wird nun nur noch aktiviert, wenn auf Kommandozeile angegeben.
+ *
+ * Revision 1.20 2002/01/11 23:50:55 alex
+ * - LINKS implementiert, LUSERS begonnen.
+ *
+ * Revision 1.19 2002/01/09 01:08:42 alex
+ * - Parses handhabt Leerzeichen zw. Parametern nun etwas "lockerer".
+ *
* Revision 1.18 2002/01/07 15:29:11 alex
* - Status-Codes an den Server selber werden ignoriert, besseres Logging.
*
#include <stdio.h>
#include <string.h>
+#include "ngircd.h"
#include "client.h"
#include "conn.h"
#include "irc.h"
assert( Request != NULL );
#ifdef SNIFFER
- Log( LOG_DEBUG, " <- connection %d: '%s'.", Idx, Request );
+ if( NGIRCd_Sniffer ) Log( LOG_DEBUG, " <- connection %d: '%s'.", Idx, Request );
#endif
Init_Request( &req );
ptr = strchr( Request, ' ' );
if( ! ptr ) return Parse_Error( Idx, "Prefix without command!?" );
*ptr = '\0';
+#ifndef STRICT_RFC
+ /* multiple Leerzeichen als Trenner zwischen
+ * Prefix und Befehl ignorieren */
+ while( *(ptr + 1) == ' ' ) ptr++;
+#endif
start = ptr + 1;
}
else start = Request;
/* Befehl */
ptr = strchr( start, ' ' );
- if( ptr ) *ptr = '\0';
+ if( ptr )
+ {
+ *ptr = '\0';
+#ifndef STRICT_RFC
+ /* multiple Leerzeichen als Trenner vor
+ *Parametertrennern ignorieren */
+ while( *(ptr + 1) == ' ' ) ptr++;
+#endif
+ }
req.command = start;
if( ! Validate_Command( &req )) return Parse_Error( Idx, "Invalid command" );
{
req.argv[req.argc] = start;
ptr = strchr( start, ' ' );
- if( ptr ) *ptr = '\0';
+ if( ptr )
+ {
+ *ptr = '\0';
+#ifndef STRICT_RFC
+ /* multiple Leerzeichen als
+ * Parametertrenner ignorieren */
+ while( *(ptr + 1) == ' ' ) ptr++;
+#endif
+ }
}
req.argc++;
else if( strcasecmp( Req->command, "DIE" ) == 0 ) return IRC_DIE( client, Req );
else if( strcasecmp( Req->command, "RESTART" ) == 0 ) return IRC_RESTART( client, Req );
else if( strcasecmp( Req->command, "ERROR" ) == 0 ) return IRC_ERROR( client, Req );
+ else if( strcasecmp( Req->command, "LUSERS" ) == 0 ) return IRC_LUSERS( client, Req );
+ else if( strcasecmp( Req->command, "LINKS" ) == 0 ) return IRC_LINKS( client, Req );
/* Unbekannter Befehl */
if( Client_Type( client ) != CLIENT_SERVER ) IRC_WriteStrClient( client, ERR_UNKNOWNCOMMAND_MSG, Client_ID( client ), Req->command );