authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-02-18 17:09:13-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2024-02-23 02:37:11-07:00
logf1565e3d09f4c8a0d5c55a635a7e7f9925eae20f
tree55fdaa0d28b5a7e62b282fac459bdefa6dd64e91
parentc44a90283699246172a77429a04288b19d38f075

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


1 files changed, 1 insertions(+), 3 deletions(-)

lib/std/http/Server.zig+1-3
...@@ -672,17 +672,15 @@ pub fn listen(server: *Server, address: net.Address) ListenError!void {...@@ -672,17 +672,15 @@ pub fn listen(server: *Server, address: net.Address) ListenError!void {
672 try server.socket.listen(address);672 try server.socket.listen(address);
673}673}
674674
675pub const AcceptError = net.StreamServer.AcceptError || Allocator.Error;675pub const AcceptError = net.StreamServer.AcceptError;
676676
677pub const AcceptOptions = struct {677pub const AcceptOptions = struct {
678 allocator: Allocator,
679 /// Externally-owned memory used to store the client's entire HTTP header.678 /// Externally-owned memory used to store the client's entire HTTP header.
680 /// `error.HttpHeadersOversize` is returned from read() when a679 /// `error.HttpHeadersOversize` is returned from read() when a
681 /// client sends too many bytes of HTTP headers.680 /// client sends too many bytes of HTTP headers.
682 client_header_buffer: []u8,681 client_header_buffer: []u8,
683};682};
684683
685/// Accept a new connection.
686pub fn accept(server: *Server, options: AcceptOptions) AcceptError!Response {684pub fn accept(server: *Server, options: AcceptOptions) AcceptError!Response {
687 const in = try server.socket.accept();685 const in = try server.socket.accept();
688686