diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-08-10 11:06:36 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-10 11:06:36 -0700 |
| commit | e25168d01be35bea2c8e811fb5fddab847ae6938 (patch) | |
| tree | 2b085034a0cd8e46fb778dea134d48e55e7be418 /lib/std/Build | |
| parent | 6eeceb4b14965a11d3f6b2969b82a696ba99bffc (diff) | |
| parent | 95f57c3369181123aa7ebd4a9654fc489f8bb4fd (diff) | |
| download | zig-e25168d01be35bea2c8e811fb5fddab847ae6938.tar.gz zig-e25168d01be35bea2c8e811fb5fddab847ae6938.zip | |
Merge pull request #24774 from kcbanner/fixup_webui_windows
Fix `respondWebSocket`, use overlapped sockets on Windows, and re-enable --webui
Diffstat (limited to 'lib/std/Build')
| -rw-r--r-- | lib/std/Build/WebServer.zig | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/lib/std/Build/WebServer.zig b/lib/std/Build/WebServer.zig index 868aabe67e..454e9196b9 100644 --- a/lib/std/Build/WebServer.zig +++ b/lib/std/Build/WebServer.zig @@ -65,16 +65,6 @@ pub fn init(opts: Options) WebServer { std.process.fatal("--webui not yet implemented for single-threaded builds", .{}); } - if (builtin.os.tag == .windows) { - // At the time of writing, there are two bugs in the standard library which break this feature on Windows: - // * Reading from a socket on one thread while writing to it on another seems to deadlock. - // * Vectored writes to sockets currently trigger an infinite loop when a buffer has length 0. - // - // Both of these bugs are expected to be solved by changes which are currently in the unmerged - // 'wrangle-writer-buffering' branch. Until that makes it in, this must remain disabled. - std.process.fatal("--webui is currently disabled on Windows due to bugs", .{}); - } - const all_steps = opts.all_steps; const step_names_trailing = opts.gpa.alloc(u8, len: { @@ -297,7 +287,8 @@ fn serveWebSocket(ws: *WebServer, sock: *http.Server.WebSocket) !noreturn { copy.* = @atomicLoad(u8, shared, .monotonic); } - _ = try std.Thread.spawn(.{}, recvWebSocketMessages, .{ ws, sock }); + const recv_thread = try std.Thread.spawn(.{}, recvWebSocketMessages, .{ ws, sock }); + defer recv_thread.join(); { const hello_header: abi.Hello = .{ |
