ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/tewi/Server/server.c
(Generate patch)

Comparing Server/server.c (file contents):
Revision 1.5 by nishi, Sun Oct 20 20:52:55 2024 UTC vs.
Revision 1.9 by nishi, Mon Oct 28 00:12:13 2024 UTC

# Line 343 | Line 343 | void _tw_process_page(SSL* ssl, int sock
343          incr = 0;
344          while(1) {
345                  if(f != NULL) {
346 <                        char buffer[128];
347 <                        fread(buffer, size < 128 ? size : 128, 1, f);
348 <                        tw_write(ssl, sock, buffer, size < 128 ? size : 128);
346 >                        char buffer[512];
347 >                        int st;
348 >                        fread(buffer, size < 512 ? size : 512, 1, f);
349 >                        if((st = tw_write(ssl, sock, buffer, size < 512 ? size : 512)) <= 0) break;
350                  } else {
351 <                        tw_write(ssl, sock, (unsigned char*)doc + incr, size < 128 ? size : 128);
351 >                        if(tw_write(ssl, sock, (unsigned char*)doc + incr, size < 512 ? size : 512) <= 0) break;
352                  }
353 <                incr += 128;
354 <                if(size <= 128) break;
355 <                size -= 128;
353 >                incr += 512;
354 >                if(size <= 512) break;
355 >                size -= 512;
356          }
357   }
358  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines