summaryrefslogtreecommitdiff
path: root/opentracker.c
diff options
context:
space:
mode:
authorerdgeist <>2007-01-18 02:40:18 +0000
committererdgeist <>2007-01-18 02:40:18 +0000
commitccafcb0ff91d25a388e6fc8c9104851d51d67758 (patch)
tree730f1edf63edb4f5eb2de13f477ed19ca11c5019 /opentracker.c
parent2ee37881ff4b464a572eeb413bff6e7a8e2d4113 (diff)
Give our server some air to check for timedout connections
Diffstat (limited to 'opentracker.c')
-rw-r--r--opentracker.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/opentracker.c b/opentracker.c
index 1d18e49..34a393e 100644
--- a/opentracker.c
+++ b/opentracker.c
@@ -408,8 +408,6 @@ void handle_read( int64 clientsocket, int afteraccept ) {
408 return; 408 return;
409 } 409 }
410 410
411 if( afteraccept ) fprintf( stderr, "*" );
412
413 array_catb(&h->r,static_scratch,l); 411 array_catb(&h->r,static_scratch,l);
414 412
415 if( array_failed(&h->r)) 413 if( array_failed(&h->r))
@@ -430,6 +428,8 @@ void server_mainloop( int64 serversocket ) {
430 428
431 for (;;) { 429 for (;;) {
432 int64 i; 430 int64 i;
431 int handled_connections = 1024;
432
433 taia_now(&t); 433 taia_now(&t);
434 taia_addsec(&t,&t,OT_CLIENT_TIMEOUT_CHECKINTERVAL); 434 taia_addsec(&t,&t,OT_CLIENT_TIMEOUT_CHECKINTERVAL);
435 io_waituntil(t); 435 io_waituntil(t);
@@ -448,7 +448,7 @@ void server_mainloop( int64 serversocket ) {
448 taia_addsec(&next_timeout_check,&next_timeout_check,OT_CLIENT_TIMEOUT_CHECKINTERVAL); 448 taia_addsec(&next_timeout_check,&next_timeout_check,OT_CLIENT_TIMEOUT_CHECKINTERVAL);
449 } 449 }
450 450
451 while( ( i = io_canread() ) != -1 ) { 451 while( --handled_connections && ( ( i = io_canread() ) != -1 ) ) {
452 452
453 if( i != serversocket ) { 453 if( i != serversocket ) {
454 handle_read( i, 0 ); 454 handle_read( i, 0 );