add workaround for 16KiB TLS issue

This commit is contained in:
Emil Lerch 2023-10-20 14:37:52 -07:00
parent d49ccfcb2a
commit fd37671cf6
Signed by: lobo
GPG Key ID: A7B62D657EF764F8

View File

@ -291,7 +291,14 @@ fn putNewWorker(allocator: std.mem.Allocator, client: *std.http.Client, worker:
req.transfer_encoding = .{ .content_length = @as(u64, request_payload.len) };
try req.start();
try req.writeAll(request_payload);
// Workaround for https://github.com/ziglang/zig/issues/15626
const max_bytes: usize = 1 << 14;
var inx: usize = 0;
while (request_payload.len > inx) {
try req.writeAll(request_payload[inx..@min(request_payload.len, inx + max_bytes)]);
inx += max_bytes;
}
try req.finish();
try req.wait();
// std.debug.print("Status is {}\n", .{req.response.status});