From 9017d758b96c1f296249670dffb774a598bc8598 Mon Sep 17 00:00:00 2001 From: Nameless Date: Sat, 6 May 2023 21:35:04 -0500 Subject: [PATCH] std.http: use larger read buffer to hit faster tls code --- lib/std/http/Client.zig | 2 +- lib/std/http/Server.zig | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/std/http/Client.zig b/lib/std/http/Client.zig index 77f4c6c6c3..023bdd28bc 100644 --- a/lib/std/http/Client.zig +++ b/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, diff --git a/lib/std/http/Server.zig b/lib/std/http/Server.zig index 2d3032bcdb..6b5db6725f 100644 --- a/lib/std/http/Server.zig +++ b/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,