summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <>2007-10-16 18:23:36 +0000
committererdgeist <>2007-10-16 18:23:36 +0000
commit1e6b48cbc0f426901a9fa5e7045a52f28d110361 (patch)
treeb77e4c527ee18ef0cae7346c4f7957995df6745e
parentc730a24d0a0c12173ddcd105d6e5344205eb7503 (diff)
Sockets we write to now do also timeout
-rw-r--r--opentracker.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/opentracker.c b/opentracker.c
index 87e8b6f..ae755cc 100644
--- a/opentracker.c
+++ b/opentracker.c
@@ -48,7 +48,11 @@ static char *accesslist_filename = NULL;
48#define WANT_ACCESS_CONTROL 48#define WANT_ACCESS_CONTROL
49#endif 49#endif
50 50
51#ifndef NO_FULLSCRAPE_LOGGING
51#define LOG_TO_STDERR( ... ) fprintf( stderr, __VA_ARGS__ ) 52#define LOG_TO_STDERR( ... ) fprintf( stderr, __VA_ARGS__ )
53#else
54#define LOG_TO_STDERR( ... )
55#endif
52 56
53/* To always have space for error messages ;) */ 57/* To always have space for error messages ;) */
54 58
@@ -150,8 +154,9 @@ static void sendmallocdata( const int64 s, char *buffer, size_t size ) {
150 iob_addbuf_free( &h->batch, header, header_size ); 154 iob_addbuf_free( &h->batch, header, header_size );
151 iob_addbuf_free( &h->batch, buffer, size ); 155 iob_addbuf_free( &h->batch, buffer, size );
152 156
153 /* writeable sockets just have a tcp timeout */ 157 /* writeable sockets timeout after twice the pool timeout
154 taia_uint( &t, 0 ); io_timeout( s, t ); 158 which defaults to 5 minutes (e.g. after 10 minutes) */
159 taia_uint( &t, 2 * OT_POOLS_TIMEOUT ); io_timeout( s, t );
155 io_dontwantread( s ); 160 io_dontwantread( s );
156 io_wantwrite( s ); 161 io_wantwrite( s );
157} 162}
@@ -180,8 +185,9 @@ static void senddata( const int64 s, char *buffer, size_t size ) {
180 memmove( outbuf, buffer + written_size, size - written_size ); 185 memmove( outbuf, buffer + written_size, size - written_size );
181 iob_addbuf_free( &h->batch, outbuf, size - written_size ); 186 iob_addbuf_free( &h->batch, outbuf, size - written_size );
182 187
183 /* writeable sockets just have a tcp timeout */ 188 /* writeable sockets timeout after twice the pool timeout
184 taia_uint( &t, 0 ); io_timeout( s, t ); 189 which defaults to 5 minutes (e.g. after 10 minutes) */
190 taia_uint( &t, 2 * OT_POOLS_TIMEOUT ); io_timeout( s, t );
185 io_dontwantread( s ); 191 io_dontwantread( s );
186 io_wantwrite( s ); 192 io_wantwrite( s );
187 } 193 }