zig

fork of https://codeberg.org/ziglang/zig
Log | Files | Refs | README | LICENSE

commit f1565e3d09f4c8a0d5c55a635a7e7f9925eae20f (tree)
parent c44a90283699246172a77429a04288b19d38f075
Author: Andrew Kelley <andrew@ziglang.org>
Date:   Sun, 18 Feb 2024 17:09:13 -0700

std.http.Server.accept can no longer fail from OOM

Diffstat:
Mlib/std/http/Server.zig | 4+---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/lib/std/http/Server.zig b/lib/std/http/Server.zig @@ -672,17 +672,15 @@ pub fn listen(server: *Server, address: net.Address) ListenError!void { try server.socket.listen(address); } -pub const AcceptError = net.StreamServer.AcceptError || Allocator.Error; +pub const AcceptError = net.StreamServer.AcceptError; pub const AcceptOptions = struct { - allocator: Allocator, /// Externally-owned memory used to store the client's entire HTTP header. /// `error.HttpHeadersOversize` is returned from read() when a /// client sends too many bytes of HTTP headers. client_header_buffer: []u8, }; -/// Accept a new connection. pub fn accept(server: *Server, options: AcceptOptions) AcceptError!Response { const in = try server.socket.accept();