From ed96e2ff664c6085500c939b775975898e07f0b0 Mon Sep 17 00:00:00 2001 From: Emil Lerch Date: Sat, 21 Oct 2023 10:20:09 -0700 Subject: [PATCH] support for >16KiB requests --- src/aws_http.zig | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/aws_http.zig b/src/aws_http.zig index 86777cb..b3f886e 100644 --- a/src/aws_http.zig +++ b/src/aws_http.zig @@ -216,7 +216,14 @@ pub const AwsHttp = struct { try @import("http_client_17015_issue.zig").start(&req); // try req.start(); if (request_cp.body.len > 0) { - try req.writeAll(request_cp.body); + // Workaround for https://github.com/ziglang/zig/issues/15626 + const max_bytes: usize = 1 << 14; + var inx: usize = 0; + while (request_cp.body.len > inx) { + try req.writeAll(request_cp.body[inx..@min(request_cp.body.len, inx + max_bytes)]); + inx += max_bytes; + } + try req.finish(); } try req.wait();