]> Nishi Git Mirror - tewi.git/commitdiff
handle error
authorNishi <nishi@nishi.boats>
Sun, 27 Oct 2024 23:55:11 +0000 (23:55 +0000)
committerNishi <nishi@nishi.boats>
Sun, 27 Oct 2024 23:55:11 +0000 (23:55 +0000)
git-svn-id: file:///raid/svn-personal/tewi/trunk@394 8739d7e6-ffea-ec47-b151-bdff447c6205

Server/server.c

index 0c521c86b64e8a2f4e7ff19790ee04e5a18f63ad..3f1d5480298d8b7a9044059b2700190eaf3d3614 100644 (file)
@@ -345,9 +345,9 @@ void _tw_process_page(SSL* ssl, int sock, const char* status, const char* type,
                if(f != NULL) {
                        char buffer[512];
                        fread(buffer, size < 512 ? size : 512, 1, f);
-                       tw_write(ssl, sock, buffer, size < 512 ? size : 512);
+                       if(tw_write(ssl, sock, buffer, size < 512 ? size : 512) < 0) return;
                } else {
-                       tw_write(ssl, sock, (unsigned char*)doc + incr, size < 512 ? size : 512);
+                       if(tw_write(ssl, sock, (unsigned char*)doc + incr, size < 512 ? size : 512) < 0) return;
                }
                incr += 512;
                if(size <= 512) break;