diff options
author | erdgeist <> | 2007-11-02 03:21:56 +0000 |
---|---|---|
committer | erdgeist <> | 2007-11-02 03:21:56 +0000 |
commit | d276addb7a010a52b41080f3b8cee95bdcc7df7d (patch) | |
tree | 171ce45dde36776324e8438348bf7179748bee56 | |
parent | 853dc33be26a8c5fbad59f0193909366cdb34c2c (diff) |
Trying to accept connections only when data has come in. This is an experiment.
-rw-r--r-- | opentracker.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/opentracker.c b/opentracker.c index 00210d2..b7e5876 100644 --- a/opentracker.c +++ b/opentracker.c | |||
@@ -741,6 +741,8 @@ static void handle_accept( const int64 serversocket ) { | |||
741 | taia_uint( &t, 0 ); /* Clear t */ | 741 | taia_uint( &t, 0 ); /* Clear t */ |
742 | tai_unix( &(t.sec), (g_now + OT_CLIENT_TIMEOUT) ); | 742 | tai_unix( &(t.sec), (g_now + OT_CLIENT_TIMEOUT) ); |
743 | io_timeout( i, t ); | 743 | io_timeout( i, t ); |
744 | |||
745 | handle_read( i ); | ||
744 | } | 746 | } |
745 | 747 | ||
746 | if( errno == EAGAIN ) | 748 | if( errno == EAGAIN ) |
@@ -893,6 +895,9 @@ static void ot_try_bind( char ip[4], uint16 port, int is_tcp ) { | |||
893 | if( !io_fd( s ) ) | 895 | if( !io_fd( s ) ) |
894 | panic( "io_fd" ); | 896 | panic( "io_fd" ); |
895 | 897 | ||
898 | if( is_tcp ) | ||
899 | socket_deferaccept( s, DATAIN ); | ||
900 | |||
896 | io_setcookie( s, is_tcp ? FLAG_TCP : FLAG_UDP ); | 901 | io_setcookie( s, is_tcp ? FLAG_TCP : FLAG_UDP ); |
897 | 902 | ||
898 | io_wantread( s ); | 903 | io_wantread( s ); |