support for >16KiB requests
All checks were successful
AWS-Zig Build / build-zig-0.11.0-amd64-host (push) Successful in 7m44s

This commit is contained in:
Emil Lerch 2023-10-21 10:20:09 -07:00
parent de914ccedf
commit ed96e2ff66
Signed by: lobo
GPG Key ID: A7B62D657EF764F8

View File

@ -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();