diff options
author | 2022-01-24 19:12:58 -0800 | |
---|---|---|
committer | 2022-01-24 19:12:58 -0800 | |
commit | ecea12d2061f3508b9e5686d605ab7e6e6ac932e (patch) | |
tree | 27484c7d7ebc060ebee1365d0eac84836d0cb616 /src/http_client_async.zig | |
parent | 61d1c7b6b2efadad4e6bb27ad72b2fb45d0f5e9a (diff) | |
download | bun-ecea12d2061f3508b9e5686d605ab7e6e6ac932e.tar.gz bun-ecea12d2061f3508b9e5686d605ab7e6e6ac932e.tar.zst bun-ecea12d2061f3508b9e5686d605ab7e6e6ac932e.zip |
No io_uring for Ubuntu 20.04
Diffstat (limited to 'src/http_client_async.zig')
-rw-r--r-- | src/http_client_async.zig | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/http_client_async.zig b/src/http_client_async.zig index 21bc183be..069908322 100644 --- a/src/http_client_async.zig +++ b/src/http_client_async.zig @@ -32,6 +32,15 @@ pub var default_arena: Arena = undefined; pub fn onThreadStart() void { default_arena = Arena.init() catch unreachable; default_allocator = default_arena.allocator(); + NetworkThread.address_list_cached = NetworkThread.AddressListCache.init(default_allocator); + AsyncIO.global = AsyncIO.init(1024, 0) catch |err| { + Output.prettyErrorln("<r><red>error<r>: Failed to initialize network thread: <red><b>{s}<r>.\nHTTP requests will not work. Please file an issue and run strace().", .{@errorName(err)}); + Output.flush(); + os.exit(1); + }; + + AsyncIO.global_loaded = true; + NetworkThread.global.pool.io = &AsyncIO.global; } pub const Headers = struct { |