Stop sending data to the client after the first failure.
authorGlenn L McGrath <bug1@ihug.co.nz>
Mon, 8 Dec 2003 20:21:53 +0000 (20:21 -0000)
committerGlenn L McGrath <bug1@ihug.co.nz>
Mon, 8 Dec 2003 20:21:53 +0000 (20:21 -0000)
Patch by Joe.C

networking/httpd.c

index ba65e13..1a3f5f9 100644 (file)
@@ -1337,7 +1337,8 @@ static int sendFile(const char *url)
 
        sendHeaders(HTTP_OK);
        while ((count = bb_full_read(f, buf, MAX_MEMORY_BUFF)) > 0) {
-               bb_full_write(a_c_w, buf, count);
+               if (bb_full_write(a_c_w, buf, count) != count)
+                       break;
        }
        close(f);
   } else {