Changeset 4fe4be2
- Timestamp:
- 2006-01-10T14:20:48Z (19 years ago)
- Branches:
- master
- Children:
- dd8d4c5
- Parents:
- 2d75b56
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
bitlbee.c
r2d75b56 r4fe4be2 220 220 int st, size; 221 221 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 235 223 if( irc->sendbuffer == NULL ) 236 224 return( FALSE ); 237 225 238 226 size = strlen( irc->sendbuffer ); 239 240 #ifdef FLOOD_SEND241 if( ( FLOOD_SEND_BYTES - irc->sentbytes ) > size )242 st = write( irc->fd, irc->sendbuffer, size );243 else244 st = write( irc->fd, irc->sendbuffer, ( FLOOD_SEND_BYTES - irc->sentbytes ) );245 #else246 227 st = write( irc->fd, irc->sendbuffer, size ); 247 #endif248 228 249 229 if( st <= 0 ) … … 259 239 } 260 240 } 261 262 #ifdef FLOOD_SEND263 irc->sentbytes += st;264 #endif265 241 266 242 if( st == size ) -
configure
r2d75b56 r4fe4be2 23 23 debug=0 24 24 strip=1 25 flood=026 25 ipv6=1 27 26 ssl=auto … … 289 288 fi 290 289 291 if [ "$flood" = 1 ]; then292 # echo '#define FLOOD_SEND' >> config.h293 echo 'Flood protection is disabled in this release because of too many bugs.' 2> /dev/stderr294 rm config.h295 rm Makefile.settings296 exit 1297 fi298 299 290 echo 300 291 if [ -z "$BITLBEE_VERSION" -a -d .bzr -a -x "`which bzr`" ]; then -
irc.c
r2d75b56 r4fe4be2 941 941 if( irc->sendbuffer != NULL ) { 942 942 size = strlen( irc->sendbuffer ) + strlen( line ); 943 #ifdef FLOOD_SEND944 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 half950 * 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 #endif958 943 irc->sendbuffer = g_renew ( char, irc->sendbuffer, size + 1 ); 959 944 strcpy( ( irc->sendbuffer + strlen( irc->sendbuffer ) ), line ); -
irc.h
r2d75b56 r4fe4be2 32 32 #define IRC_LOGIN_TIMEOUT 60 33 33 #define IRC_PING_STRING "PinglBee" 34 35 /* #define FLOOD_SEND36 * Not yet enabled by default due to some problems.37 */38 #define FLOOD_SEND_INTERVAL 3039 #define FLOOD_SEND_BYTES (1024*10)40 #define FLOOD_SEND_MAXBUFFER (1024*20)41 34 42 35 #define UMODES "ias"
Note: See TracChangeset
for help on using the changeset viewer.