From 583e5570af7de27d6f267d382fbf0fc2ac279b77 Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Tue, 6 Jan 2015 15:37:25 +0000 Subject: [PATCH] Check for errors from socket_receive. git-svn-id: svn://kolibrios.org@5358 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/develop/libraries/network/network.asm | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/programs/develop/libraries/network/network.asm b/programs/develop/libraries/network/network.asm index a1349a4063..a4cd56dc6a 100644 --- a/programs/develop/libraries/network/network.asm +++ b/programs/develop/libraries/network/network.asm @@ -763,9 +763,13 @@ end virtual push edi mcall 75, 7, , , 512, MSG_DONTWAIT pop edi -; 3. Ignore events for other socketnums (return if no data read) - test eax, eax - jz .ret.more_processing_required +; 3. Check for socket errors + cmp eax, -1 + jne @f + cmp ebx, EWOULDBLOCK + je .ret.more_processing_required + jmp .ret.no_recovery + @@: ; 4. Sanity check: discard too short packets. xchg ecx, eax ; save packet length in ecx cmp ecx, 12