From 076e3b76488148837fb00369a495297f4363cba2 Mon Sep 17 00:00:00 2001 From: Nishi Date: Sun, 27 Oct 2024 23:55:11 +0000 Subject: [PATCH] handle error git-svn-id: file:///raid/svn-personal/tewi/trunk@394 8739d7e6-ffea-ec47-b151-bdff447c6205 --- Server/server.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Server/server.c b/Server/server.c index 0c521c8..3f1d548 100644 --- a/Server/server.c +++ b/Server/server.c @@ -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; -- 2.43.0