summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--opentracker.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/opentracker.c b/opentracker.c
index 10e9f65..28ac071 100644
--- a/opentracker.c
+++ b/opentracker.c
@@ -166,7 +166,8 @@ static void sendmmapdata( const int64 s, char *buffer, size_t size ) {
166 166
167 /* writeable sockets timeout after twice the pool timeout 167 /* writeable sockets timeout after twice the pool timeout
168 which defaults to 5 minutes (e.g. after 10 minutes) */ 168 which defaults to 5 minutes (e.g. after 10 minutes) */
169 taia_uint( &t, (unsigned int)(g_now + OT_CLIENT_TIMEOUT_SEND) ); io_timeout( s, t ); 169 taia_now( &t ); taia_addsec( &t, &t, OT_CLIENT_TIMEOUT_SEND );
170 io_timeout( s, t );
170 io_dontwantread( s ); 171 io_dontwantread( s );
171 io_wantwrite( s ); 172 io_wantwrite( s );
172} 173}
@@ -199,9 +200,8 @@ static void senddata( const int64 s, char *buffer, size_t size ) {
199 iob_addbuf_free( &h->batch, outbuf, size - written_size ); 200 iob_addbuf_free( &h->batch, outbuf, size - written_size );
200 h->flag |= STRUCT_HTTP_FLAG_IOB_USED; 201 h->flag |= STRUCT_HTTP_FLAG_IOB_USED;
201 202
202 /* writeable sockets timeout after twice the pool timeout 203 /* writeable short data sockets just have a tcp timeout */
203 which defaults to 5 minutes (e.g. after 10 minutes) */ 204 taia_uint( &t, 0 ); io_timeout( s, t );
204 taia_uint( &t, (unsigned int)(g_now + OT_CLIENT_TIMEOUT_SEND) ); io_timeout( s, t );
205 io_dontwantread( s ); 205 io_dontwantread( s );
206 io_wantwrite( s ); 206 io_wantwrite( s );
207 } 207 }
@@ -647,7 +647,10 @@ static void handle_accept( const int64 serversocket ) {
647 647
648 ++ot_overall_tcp_connections; 648 ++ot_overall_tcp_connections;
649 649
650 taia_uint( &t, (unsigned int)(g_now + OT_CLIENT_TIMEOUT) ); 650 /* That breaks taia encapsulation. But there is no way to take system
651 time this often in FreeBSD and libowfat does not allow to set unix time */
652 taia_uint( &t, 0 ); /* Clear t */
653 tai_unix( &(t.sec), (g_now + OT_CLIENT_TIMEOUT) );
651 io_timeout( i, t ); 654 io_timeout( i, t );
652 } 655 }
653 656