| ... | @@ -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 | } |
| 674 | | 674 | |
| 675 | pub const AcceptError = net.StreamServer.AcceptError || Allocator.Error; | 675 | pub const AcceptError = net.StreamServer.AcceptError; |
| 676 | | 676 | |
| 677 | pub const AcceptOptions = struct { | 677 | pub 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 a | 679 | /// `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 | }; |
| 684 | | 683 | |
| 685 | /// Accept a new connection. | | |
| 686 | pub fn accept(server: *Server, options: AcceptOptions) AcceptError!Response { | 684 | pub fn accept(server: *Server, options: AcceptOptions) AcceptError!Response { |
| 687 | const in = try server.socket.accept(); | 685 | const in = try server.socket.accept(); |
| 688 | | 686 | |