| ... | @@ -393,7 +393,7 @@ pub const Response = struct { | ... | @@ -393,7 +393,7 @@ pub const Response = struct { |
| 393 | pub const DoError = Connection.WriteError || error{ UnsupportedTransferEncoding, InvalidContentLength }; | 393 | pub const DoError = Connection.WriteError || error{ UnsupportedTransferEncoding, InvalidContentLength }; |
| 394 | | 394 | |
| 395 | /// Send the response headers. | 395 | /// Send the response headers. |
| 396 | pub fn do(res: *Response) !void { | 396 | pub fn do(res: *Response) DoError!void { |
| 397 | switch (res.state) { | 397 | switch (res.state) { |
| 398 | .waited => res.state = .responded, | 398 | .waited => res.state = .responded, |
| 399 | .first, .start, .responded, .finished => unreachable, | 399 | .first, .start, .responded, .finished => unreachable, |
| ... | @@ -668,7 +668,7 @@ pub fn deinit(server: *Server) void { | ... | @@ -668,7 +668,7 @@ pub fn deinit(server: *Server) void { |
| 668 | pub const ListenError = std.os.SocketError || std.os.BindError || std.os.ListenError || std.os.SetSockOptError || std.os.GetSockNameError; | 668 | pub const ListenError = std.os.SocketError || std.os.BindError || std.os.ListenError || std.os.SetSockOptError || std.os.GetSockNameError; |
| 669 | | 669 | |
| 670 | /// Start the HTTP server listening on the given address. | 670 | /// Start the HTTP server listening on the given address. |
| 671 | pub fn listen(server: *Server, address: net.Address) !void { | 671 | 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 | |