X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=src%2Fngircd%2Firc-write.c;h=25cecaff8e90c13e350189dad7e39db2883c0932;hb=1b349b05d5040de19921f087785310dfe24ef5df;hp=526e2fb694bdf948ccf957f6fafb9a8ca5571d25;hpb=904c8a4375cb9deed64007b06c6a7ba42313d93d;p=ngircd-alex.git diff --git a/src/ngircd/irc-write.c b/src/ngircd/irc-write.c index 526e2fb6..25cecaff 100644 --- a/src/ngircd/irc-write.c +++ b/src/ngircd/irc-write.c @@ -538,24 +538,27 @@ va_dcl /** * Set a "penalty time" for an IRC client. * - * Note: penalty times are never set for server links! + * Note: penalty times are never set for server links or remote clients! * * @param Client The client. * @param Seconds The additional "penalty time" to enforce. */ GLOBAL void -IRC_SetPenalty( CLIENT *Client, time_t Seconds ) +IRC_SetPenalty(CLIENT *Client, time_t Seconds) { CONN_ID c; - assert( Client != NULL ); - assert( Seconds > 0 ); + assert(Client != NULL); + assert(Seconds > 0); + + if (Client_Type(Client) == CLIENT_SERVER) + return; - if( Client_Type( Client ) == CLIENT_SERVER ) return; + c = Client_Conn(Client); + if (c <= NONE) + return; - c = Client_Conn( Client ); - if (c > NONE) - Conn_SetPenalty(c, Seconds); + Conn_SetPenalty(c, Seconds); } /* IRC_SetPenalty */ static const char *