From 1a349bfa4346acd18b8646ec2eaa0f237a83e3f3 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Wed, 21 Apr 2021 20:14:58 +0200 Subject: [PATCH] Add a handler for the EAGAIN reason code to iob_send --- opentracker.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/opentracker.c b/opentracker.c index 1c729cf..441639a 100644 --- a/opentracker.c +++ b/opentracker.c @@ -204,7 +204,11 @@ static void handle_read( const int64 sock, struct ot_workstruct *ws ) { static void handle_write( const int64 sock ) { struct http_data* cookie=io_getcookie( sock ); - if( !cookie || ( iob_send( sock, &cookie->batch ) <= 0 ) ) + if( cookie ) { + int64 res = iob_send( sock, &cookie->batch ); + if (res == 0 || res == -3) + handle_dead( sock ); + } else handle_dead( sock ); }