]> git.ipfire.org Git - thirdparty/opentracker.git/commitdiff
Trying to accept connections only when data has come in. This is an experiment.
authorerdgeist <>
Fri, 2 Nov 2007 03:21:56 +0000 (03:21 +0000)
committererdgeist <>
Fri, 2 Nov 2007 03:21:56 +0000 (03:21 +0000)
opentracker.c

index 00210d287931849f1698144fa12e79d217ee0f8e..b7e58768beef5cc159f6a8763b08e845652edb99 100644 (file)
@@ -741,6 +741,8 @@ static void handle_accept( const int64 serversocket ) {
     taia_uint( &t, 0 ); /* Clear t */
     tai_unix( &(t.sec), (g_now + OT_CLIENT_TIMEOUT) );
     io_timeout( i, t );
+
+    handle_read( i );
   }
 
   if( errno == EAGAIN )
@@ -893,6 +895,9 @@ static void ot_try_bind( char ip[4], uint16 port, int is_tcp ) {
   if( !io_fd( s ) )
     panic( "io_fd" );
 
+  if( is_tcp )
+    socket_deferaccept( s, DATAIN );
+
   io_setcookie( s, is_tcp ? FLAG_TCP : FLAG_UDP );
 
   io_wantread( s );