| ... | ... | @@ -19,6 +19,8 @@ pub const Method = enum { |
| 19 | 19 | }; |
| 20 | 20 | |
| 21 | 21 | pub const Status = enum(u10) { |
| 22 | invalid = 0, |
| 23 | |
| 22 | 24 | @"continue" = 100, // RFC7231, Section 6.2.1 |
| 23 | 25 | switching_protocols = 101, // RFC7231, Section 6.2.2 |
| 24 | 26 | processing = 102, // RFC2518 |
| ... | ... | @@ -175,7 +177,7 @@ pub fn open(allocator: std.mem.Allocator, method: Method, input: []const u8) !Cl |
| 175 | 177 | const u = try url.URL.parse(allocator, input, null); |
| 176 | 178 | defer allocator.free(u.href); |
| 177 | 179 | |
| 178 | | const addr: net.Address = .fromUrl(&u, allocator); |
| 180 | const addr: net.Address = try .fromUrl(&u, allocator); |
| 179 | 181 | |
| 180 | 182 | const conn = try addr.tcpConnect(); |
| 181 | 183 | errdefer conn.close(); |
| ... | ... | @@ -202,7 +204,7 @@ pub fn open(allocator: std.mem.Allocator, method: Method, input: []const u8) !Cl |
| 202 | 204 | .stream = conn, |
| 203 | 205 | .writer = bufw, |
| 204 | 206 | .reader = .init(conn), |
| 205 | | .status = @enumFromInt(0), |
| 207 | .status = .invalid, |
| 206 | 208 | .headers = .init(allocator), |
| 207 | 209 | }; |
| 208 | 210 | } |