]> Nishi Git Mirror - tewi.git/commitdiff
fix
authorNishi <nishi@nishi.boats>
Mon, 28 Oct 2024 00:11:59 +0000 (00:11 +0000)
committerNishi <nishi@nishi.boats>
Mon, 28 Oct 2024 00:11:59 +0000 (00:11 +0000)
git-svn-id: file:///raid/svn-personal/tewi/trunk@398 8739d7e6-ffea-ec47-b151-bdff447c6205

Server/server.c

index 80bd9313f9b6d949c2bd2b16a62a45c596be6630..a253f95bcbe682abef4a0429f28252f16a255170 100644 (file)
@@ -344,10 +344,11 @@ void _tw_process_page(SSL* ssl, int sock, const char* status, const char* type,
        while(1) {
                if(f != NULL) {
                        char buffer[512];
+                       int st;
                        fread(buffer, size < 512 ? size : 512, 1, f);
-                       if(tw_write(ssl, sock, buffer, size < 512 ? size : 512) <= 0) return;
+                       if((st = tw_write(ssl, sock, buffer, size < 512 ? size : 512)) <= 0) break;
                } else {
-                       if(tw_write(ssl, sock, (unsigned char*)doc + incr, size < 512 ? size : 512) <= 0) return;
+                       if(tw_write(ssl, sock, (unsigned char*)doc + incr, size < 512 ? size : 512) <= 0) break;
                }
                incr += 512;
                if(size <= 512) break;