diff options
Diffstat (limited to 'src/cli/create_command.zig')
-rw-r--r-- | src/cli/create_command.zig | 28 |
1 files changed, 23 insertions, 5 deletions
diff --git a/src/cli/create_command.zig b/src/cli/create_command.zig index a0017dd34..ee6266f40 100644 --- a/src/cli/create_command.zig +++ b/src/cli/create_command.zig @@ -251,7 +251,7 @@ pub const CreateCommand = struct { @setCold(true); Global.configureAllocator(.{ .long_running = false }); - try NetworkThread.init(); + try HTTP.HTTPThread.init(); var create_options = try CreateOptions.parse(ctx, false); const positionals = create_options.positionals; @@ -1849,7 +1849,16 @@ pub const Example = struct { // ensure very stable memory address var async_http: *HTTP.AsyncHTTP = ctx.allocator.create(HTTP.AsyncHTTP) catch unreachable; - async_http.* = try HTTP.AsyncHTTP.init(ctx.allocator, .GET, api_url, header_entries, headers_buf, mutable, &request_body, 60 * std.time.ns_per_min); + async_http.* = HTTP.AsyncHTTP.initSync( + ctx.allocator, + .GET, + api_url, + header_entries, + headers_buf, + mutable, + &request_body, + 60 * std.time.ns_per_min, + ); async_http.client.progress_node = progress; const response = try async_http.sendSync(true); @@ -1912,7 +1921,7 @@ pub const Example = struct { // ensure very stable memory address var async_http: *HTTP.AsyncHTTP = ctx.allocator.create(HTTP.AsyncHTTP) catch unreachable; - async_http.* = try HTTP.AsyncHTTP.init(ctx.allocator, .GET, url, .{}, "", mutable, &request_body, 60 * std.time.ns_per_min); + async_http.* = HTTP.AsyncHTTP.initSync(ctx.allocator, .GET, url, .{}, "", mutable, &request_body, 60 * std.time.ns_per_min); async_http.client.progress_node = progress; var response = try async_http.sendSync(true); @@ -1984,7 +1993,7 @@ pub const Example = struct { mutable.reset(); // ensure very stable memory address - async_http.* = try HTTP.AsyncHTTP.init(ctx.allocator, .GET, URL.parse(tarball_url), .{}, "", mutable, &request_body, 60 * std.time.ns_per_min); + async_http.* = HTTP.AsyncHTTP.initSync(ctx.allocator, .GET, URL.parse(tarball_url), .{}, "", mutable, &request_body, 60 * std.time.ns_per_min); async_http.client.progress_node = progress; refresher.maybeRefresh(); @@ -2013,7 +2022,16 @@ pub const Example = struct { var mutable = try ctx.allocator.create(MutableString); mutable.* = try MutableString.init(ctx.allocator, 2048); - async_http.* = try HTTP.AsyncHTTP.init(ctx.allocator, .GET, url, .{}, "", mutable, &request_body, 60 * std.time.ns_per_min); + async_http.* = HTTP.AsyncHTTP.initSync( + ctx.allocator, + .GET, + url, + .{}, + "", + mutable, + &request_body, + 60 * std.time.ns_per_min, + ); if (Output.enable_ansi_colors) { async_http.client.progress_node = progress_node; |