]> git.ipfire.org Git - thirdparty/opentracker.git/commitdiff
Handle eagain case in trywrite
authorDirk Engling <erdgeist@erdgeist.org>
Sat, 8 May 2021 22:02:13 +0000 (00:02 +0200)
committerDirk Engling <erdgeist@erdgeist.org>
Sat, 8 May 2021 22:02:13 +0000 (00:02 +0200)
opentracker.c

index 7e426d2b5bfa7ea932cf6bda4223aecb69d3ae5f..32b336412a3fd7cc9118bbba9ef7653fa490d0a4 100644 (file)
@@ -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;
   }