Avoid infinite loop when the telnet session is closed client-side.
authorAdrien Grand <jpountz@videolan.org>
Wed, 25 Feb 2009 03:42:00 +0000 (04:42 +0100)
committerRémi Denis-Courmont <rdenis@simphalempin.com>
Wed, 25 Feb 2009 16:29:42 +0000 (18:29 +0200)
Signed-off-by: Rémi Denis-Courmont <rdenis@simphalempin.com>
modules/control/telnet.c

index 85ecaab..2977af8 100644 (file)
@@ -379,7 +379,7 @@ static void Run( intf_thread_t *p_intf )
                     errno = EAGAIN;
                 }
 #endif
-                if (i_recv <= 0 && ( end || errno != EAGAIN ) )
+                if( i_recv == 0 || ( i_recv == -1 && ( end || errno != EAGAIN ) ) )
                     goto drop;
             }
         }