From 4565216705e17fed561059cc33deb402d23f901d Mon Sep 17 00:00:00 2001 From: hidnplayr Date: Thu, 12 Dec 2013 12:14:39 +0000 Subject: [PATCH] Bugfix in downloader (when socket recv function returns 0, it means remote end closed the connection.) git-svn-id: svn://kolibrios.org@4345 a494cfbc-eb01-0410-851d-a64ba20cac60 --- programs/network/downloader/downloader.asm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/programs/network/downloader/downloader.asm b/programs/network/downloader/downloader.asm index 6afa15d4cc..16b860b591 100644 --- a/programs/network/downloader/downloader.asm +++ b/programs/network/downloader/downloader.asm @@ -369,9 +369,9 @@ read_incoming_data: .read: mcall recv, [socketnum], [pos], BUFFERSIZE, 0 inc eax ; -1 = error (socket closed?) + jz .error + dec eax ; 0 bytes means the remote end closed the connection jz .no_more_data - dec eax ; 0 bytes... - jz .read DEBUGF 1, "Got chunk of %u bytes\n", eax @@ -384,6 +384,9 @@ read_incoming_data: ; TODO: parse header and resize buffer only once pop eax jmp .read + + .error: + DEBUGF 1, "Socket error: %u\n", ebx .no_more_data: mov eax, [buf_ptr]