mirror of
https://github.com/osmarks/ngircd.git
synced 2025-01-15 18:15:40 +00:00
- SQUIT wird auf jeden Fall geforwarded, zudem besseres Logging.
This commit is contained in:
parent
1575e30d77
commit
b181f1bd3c
@ -9,11 +9,14 @@
|
|||||||
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
* Naehere Informationen entnehmen Sie bitter der Datei COPYING. Eine Liste
|
||||||
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
* der an ngIRCd beteiligten Autoren finden Sie in der Datei AUTHORS.
|
||||||
*
|
*
|
||||||
* $Id: irc.c,v 1.71 2002/02/27 00:50:05 alex Exp $
|
* $Id: irc.c,v 1.72 2002/02/27 02:26:58 alex Exp $
|
||||||
*
|
*
|
||||||
* irc.c: IRC-Befehle
|
* irc.c: IRC-Befehle
|
||||||
*
|
*
|
||||||
* $Log: irc.c,v $
|
* $Log: irc.c,v $
|
||||||
|
* Revision 1.72 2002/02/27 02:26:58 alex
|
||||||
|
* - SQUIT wird auf jeden Fall geforwarded, zudem besseres Logging.
|
||||||
|
*
|
||||||
* Revision 1.71 2002/02/27 00:50:05 alex
|
* Revision 1.71 2002/02/27 00:50:05 alex
|
||||||
* - einige unnoetige Client_NextHop()-Aufrufe entfernt.
|
* - einige unnoetige Client_NextHop()-Aufrufe entfernt.
|
||||||
* - NAMES korrigiert und komplett implementiert.
|
* - NAMES korrigiert und komplett implementiert.
|
||||||
@ -1045,6 +1048,7 @@ GLOBAL BOOLEAN IRC_QUIT( CLIENT *Client, REQUEST *Req )
|
|||||||
GLOBAL BOOLEAN IRC_SQUIT( CLIENT *Client, REQUEST *Req )
|
GLOBAL BOOLEAN IRC_SQUIT( CLIENT *Client, REQUEST *Req )
|
||||||
{
|
{
|
||||||
CLIENT *target;
|
CLIENT *target;
|
||||||
|
CHAR msg[128];
|
||||||
|
|
||||||
assert( Client != NULL );
|
assert( Client != NULL );
|
||||||
assert( Req != NULL );
|
assert( Req != NULL );
|
||||||
@ -1055,6 +1059,9 @@ GLOBAL BOOLEAN IRC_SQUIT( CLIENT *Client, REQUEST *Req )
|
|||||||
/* Falsche Anzahl Parameter? */
|
/* Falsche Anzahl Parameter? */
|
||||||
if( Req->argc != 2 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
|
if( Req->argc != 2 ) return IRC_WriteStrClient( Client, ERR_NEEDMOREPARAMS_MSG, Client_ID( Client ), Req->command );
|
||||||
|
|
||||||
|
/* SQUIT an alle Server weiterleiten */
|
||||||
|
IRC_WriteStrServers( Client, "SQUIT %s :%s", Req->argv[0], Req->argv[1] );
|
||||||
|
|
||||||
target = Client_GetFromID( Req->argv[0] );
|
target = Client_GetFromID( Req->argv[0] );
|
||||||
if( ! target )
|
if( ! target )
|
||||||
{
|
{
|
||||||
@ -1065,20 +1072,23 @@ GLOBAL BOOLEAN IRC_SQUIT( CLIENT *Client, REQUEST *Req )
|
|||||||
if( target == Client ) Log( LOG_DEBUG, "Got SQUIT from %s: %s", Client_ID( Client ), Req->argv[1] );
|
if( target == Client ) Log( LOG_DEBUG, "Got SQUIT from %s: %s", Client_ID( Client ), Req->argv[1] );
|
||||||
else Log( LOG_DEBUG, "Got SQUIT from %s for %s: %s", Client_ID( Client ), Client_ID( target ), Req->argv[1] );
|
else Log( LOG_DEBUG, "Got SQUIT from %s for %s: %s", Client_ID( Client ), Client_ID( target ), Req->argv[1] );
|
||||||
|
|
||||||
/* SQUIT an alle Server weiterleiten */
|
if( Req->argv[1][0] )
|
||||||
IRC_WriteStrServers( Client, "SQUIT %s :%s", Req->argv[0], Req->argv[1] );
|
{
|
||||||
|
strcpy( msg, "Got SQUIT: " );
|
||||||
|
strncpy( &msg[11], Req->argv[1], 116 );
|
||||||
|
msg[128] = '\0';
|
||||||
|
}
|
||||||
|
else strcpy( msg, "Got SQUIT command." );
|
||||||
|
|
||||||
if( Client_Conn( target ) > NONE )
|
if( Client_Conn( target ) > NONE )
|
||||||
{
|
{
|
||||||
if( Req->argv[1][0] ) Conn_Close( Client_Conn( target ), "Got SQUIT command.", Req->argv[1], TRUE );
|
/* dieser Server hat die Connection */
|
||||||
else Conn_Close( Client_Conn( target ), "Got SQUIT command.", NULL, TRUE );
|
if( Req->argv[1][0] ) Conn_Close( Client_Conn( target ), msg, Req->argv[1], TRUE );
|
||||||
|
else Conn_Close( Client_Conn( target ), msg, NULL, TRUE );
|
||||||
|
}
|
||||||
|
else Client_Destroy( target, msg, Req->argv[1] );
|
||||||
|
|
||||||
return DISCONNECTED;
|
return DISCONNECTED;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
Client_Destroy( target, "Got SQUIT command.", Req->argv[1] );
|
|
||||||
return CONNECTED;
|
|
||||||
}
|
|
||||||
} /* IRC_SQUIT */
|
} /* IRC_SQUIT */
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user