--- Server/server.c 2024/10/27 23:53:55 1.6 +++ Server/server.c 2024/10/27 23:58:24 1.8 @@ -1,4 +1,4 @@ -/* $Id: server.c,v 1.6 2024/10/27 23:53:55 nishi Exp $ */ +/* $Id: server.c,v 1.8 2024/10/27 23:58:24 nishi Exp $ */ #define SOURCE @@ -345,9 +345,9 @@ void _tw_process_page(SSL* ssl, int sock 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;