Commit 9017d758b9

Nameless <truemedian@gmail.com>
2023-05-07 04:35:04
std.http: use larger read buffer to hit faster tls code
1 parent 1b3ebfe
Changed files (2)
lib/std/http/Client.zig
@@ -251,7 +251,7 @@ pub const Connection = struct {
 
 /// A buffered (and peekable) Connection.
 pub const BufferedConnection = struct {
-    pub const buffer_size = 0x2000;
+    pub const buffer_size = std.crypto.tls.max_ciphertext_record_len;
 
     conn: Connection,
     read_buf: [buffer_size]u8 = undefined,
lib/std/http/Server.zig
@@ -95,7 +95,7 @@ pub const Connection = struct {
 
 /// A buffered (and peekable) Connection.
 pub const BufferedConnection = struct {
-    pub const buffer_size = 0x2000;
+    pub const buffer_size = std.crypto.tls.max_ciphertext_record_len;
 
     conn: Connection,
     read_buf: [buffer_size]u8 = undefined,