mirror of
git://erdgeist.org/opentracker
synced 2025-02-18 15:11:29 +08:00
Sockets we write to now do also timeout
This commit is contained in:
parent
c730a24d0a
commit
1e6b48cbc0
@ -48,7 +48,11 @@ static char *accesslist_filename = NULL;
|
|||||||
#define WANT_ACCESS_CONTROL
|
#define WANT_ACCESS_CONTROL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef NO_FULLSCRAPE_LOGGING
|
||||||
#define LOG_TO_STDERR( ... ) fprintf( stderr, __VA_ARGS__ )
|
#define LOG_TO_STDERR( ... ) fprintf( stderr, __VA_ARGS__ )
|
||||||
|
#else
|
||||||
|
#define LOG_TO_STDERR( ... )
|
||||||
|
#endif
|
||||||
|
|
||||||
/* To always have space for error messages ;) */
|
/* To always have space for error messages ;) */
|
||||||
|
|
||||||
@ -150,8 +154,9 @@ static void sendmallocdata( const int64 s, char *buffer, size_t size ) {
|
|||||||
iob_addbuf_free( &h->batch, header, header_size );
|
iob_addbuf_free( &h->batch, header, header_size );
|
||||||
iob_addbuf_free( &h->batch, buffer, size );
|
iob_addbuf_free( &h->batch, buffer, size );
|
||||||
|
|
||||||
/* writeable sockets just have a tcp timeout */
|
/* writeable sockets timeout after twice the pool timeout
|
||||||
taia_uint( &t, 0 ); io_timeout( s, t );
|
which defaults to 5 minutes (e.g. after 10 minutes) */
|
||||||
|
taia_uint( &t, 2 * OT_POOLS_TIMEOUT ); io_timeout( s, t );
|
||||||
io_dontwantread( s );
|
io_dontwantread( s );
|
||||||
io_wantwrite( s );
|
io_wantwrite( s );
|
||||||
}
|
}
|
||||||
@ -180,8 +185,9 @@ static void senddata( const int64 s, char *buffer, size_t size ) {
|
|||||||
memmove( outbuf, buffer + written_size, size - written_size );
|
memmove( outbuf, buffer + written_size, size - written_size );
|
||||||
iob_addbuf_free( &h->batch, outbuf, size - written_size );
|
iob_addbuf_free( &h->batch, outbuf, size - written_size );
|
||||||
|
|
||||||
/* writeable sockets just have a tcp timeout */
|
/* writeable sockets timeout after twice the pool timeout
|
||||||
taia_uint( &t, 0 ); io_timeout( s, t );
|
which defaults to 5 minutes (e.g. after 10 minutes) */
|
||||||
|
taia_uint( &t, 2 * OT_POOLS_TIMEOUT ); io_timeout( s, t );
|
||||||
io_dontwantread( s );
|
io_dontwantread( s );
|
||||||
io_wantwrite( s );
|
io_wantwrite( s );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user