From 99544a10306382c285e1f3166b7dcb8686ef4a2d Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sun, 9 May 2021 00:02:13 +0200 Subject: [PATCH] Handle eagain case in trywrite --- opentracker.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/opentracker.c b/opentracker.c index 7e426d2..32b3364 100644 --- a/opentracker.c +++ b/opentracker.c @@ -170,9 +170,9 @@ static void handle_dead( const int64 sock ) { static void handle_read( const int64 sock, struct ot_workstruct *ws ) { struct http_data* cookie = io_getcookie( sock ); - ssize_t byte_count; + ssize_t byte_count = io_tryread( sock, ws->inbuf, G_INBUF_SIZE ); - if( ( byte_count = io_tryread( sock, ws->inbuf, G_INBUF_SIZE ) ) <= 0 ) { + if( byte_count == 0 || byte_count == -3 ) { handle_dead( sock ); return; }