mirror of
https://github.com/ziglang/zig.git
synced 2025-12-17 11:43:16 +00:00
std.http.Server.accept can no longer fail from OOM
This commit is contained in:
parent
c44a902836
commit
f1565e3d09
@ -672,17 +672,15 @@ pub fn listen(server: *Server, address: net.Address) ListenError!void {
|
|||||||
try server.socket.listen(address);
|
try server.socket.listen(address);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const AcceptError = net.StreamServer.AcceptError || Allocator.Error;
|
pub const AcceptError = net.StreamServer.AcceptError;
|
||||||
|
|
||||||
pub const AcceptOptions = struct {
|
pub const AcceptOptions = struct {
|
||||||
allocator: Allocator,
|
|
||||||
/// Externally-owned memory used to store the client's entire HTTP header.
|
/// Externally-owned memory used to store the client's entire HTTP header.
|
||||||
/// `error.HttpHeadersOversize` is returned from read() when a
|
/// `error.HttpHeadersOversize` is returned from read() when a
|
||||||
/// client sends too many bytes of HTTP headers.
|
/// client sends too many bytes of HTTP headers.
|
||||||
client_header_buffer: []u8,
|
client_header_buffer: []u8,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Accept a new connection.
|
|
||||||
pub fn accept(server: *Server, options: AcceptOptions) AcceptError!Response {
|
pub fn accept(server: *Server, options: AcceptOptions) AcceptError!Response {
|
||||||
const in = try server.socket.accept();
|
const in = try server.socket.accept();
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user