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

Server/server.c

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