Changeset 4fe4be2


Ignore:
Timestamp:
2006-01-10T14:20:48Z (19 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
dd8d4c5
Parents:
2d75b56
Message:

Removed send-flood protection code completely.

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • bitlbee.c

    r2d75b56 r4fe4be2  
    220220        int st, size;
    221221        char *temp;
    222 #ifdef FLOOD_SEND
    223         time_t newtime;
    224 #endif
    225 
    226 #ifdef FLOOD_SEND       
    227         newtime = time( NULL );
    228         if( ( newtime - irc->oldtime ) > FLOOD_SEND_INTERVAL )
    229         {
    230                 irc->sentbytes = 0;
    231                 irc->oldtime = newtime;
    232         }
    233 #endif
    234        
     222
    235223        if( irc->sendbuffer == NULL )
    236224                return( FALSE );
    237225       
    238226        size = strlen( irc->sendbuffer );
    239        
    240 #ifdef FLOOD_SEND
    241         if( ( FLOOD_SEND_BYTES - irc->sentbytes ) > size )
    242                 st = write( irc->fd, irc->sendbuffer, size );
    243         else
    244                 st = write( irc->fd, irc->sendbuffer, ( FLOOD_SEND_BYTES - irc->sentbytes ) );
    245 #else
    246227        st = write( irc->fd, irc->sendbuffer, size );
    247 #endif
    248228       
    249229        if( st <= 0 )
     
    259239                }
    260240        }
    261        
    262 #ifdef FLOOD_SEND
    263         irc->sentbytes += st;
    264 #endif         
    265241       
    266242        if( st == size )
  • configure

    r2d75b56 r4fe4be2  
    2323debug=0
    2424strip=1
    25 flood=0
    2625ipv6=1
    2726ssl=auto
     
    289288fi
    290289
    291 if [ "$flood" = 1 ]; then
    292         # echo '#define FLOOD_SEND' >> config.h
    293         echo 'Flood protection is disabled in this release because of too many bugs.' 2> /dev/stderr
    294         rm config.h
    295         rm Makefile.settings
    296         exit 1
    297 fi
    298 
    299290echo
    300291if [ -z "$BITLBEE_VERSION" -a -d .bzr -a -x "`which bzr`" ]; then
  • irc.c

    r2d75b56 r4fe4be2  
    941941        if( irc->sendbuffer != NULL ) {
    942942                size = strlen( irc->sendbuffer ) + strlen( line );
    943 #ifdef FLOOD_SEND
    944                 if( size > FLOOD_SEND_MAXBUFFER ) {
    945                         /* Die flooder, die! >:) */
    946 
    947                         g_free(irc->sendbuffer);
    948                        
    949                         /* We need the \r\n at the start because else we might append our string to a half
    950                          * sent line. A bit hackish, but it works.
    951                          */
    952                         irc->sendbuffer = g_strdup( "\r\nERROR :Sendq Exceeded\r\n" );
    953                         irc->quit = 1;
    954                        
    955                         return;
    956                 }
    957 #endif
    958943                irc->sendbuffer = g_renew ( char, irc->sendbuffer, size + 1 );
    959944                strcpy( ( irc->sendbuffer + strlen( irc->sendbuffer ) ), line );
  • irc.h

    r2d75b56 r4fe4be2  
    3232#define IRC_LOGIN_TIMEOUT 60
    3333#define IRC_PING_STRING "PinglBee"
    34 
    35 /* #define FLOOD_SEND
    36  * Not yet enabled by default due to some problems.
    37  */
    38 #define FLOOD_SEND_INTERVAL 30
    39 #define FLOOD_SEND_BYTES (1024*10)
    40 #define FLOOD_SEND_MAXBUFFER (1024*20)
    4134
    4235#define UMODES "ias"
Note: See TracChangeset for help on using the changeset viewer.