Commit 5a4a5875dc
Changed files (1)
lib
std
http
lib/std/http/Server.zig
@@ -393,7 +393,7 @@ pub const Response = struct {
pub const DoError = Connection.WriteError || error{ UnsupportedTransferEncoding, InvalidContentLength };
/// Send the response headers.
- pub fn do(res: *Response) !void {
+ pub fn do(res: *Response) DoError!void {
switch (res.state) {
.waited => res.state = .responded,
.first, .start, .responded, .finished => unreachable,
@@ -668,7 +668,7 @@ pub fn deinit(server: *Server) void {
pub const ListenError = std.os.SocketError || std.os.BindError || std.os.ListenError || std.os.SetSockOptError || std.os.GetSockNameError;
/// Start the HTTP server listening on the given address.
-pub fn listen(server: *Server, address: net.Address) !void {
+pub fn listen(server: *Server, address: net.Address) ListenError!void {
try server.socket.listen(address);
}