| ... | @@ -213,6 +213,7 @@ pub fn open(allocator: std.mem.Allocator, method: Method, input: []const u8) !Cl | ... | @@ -213,6 +213,7 @@ pub fn open(allocator: std.mem.Allocator, method: Method, input: []const u8) !Cl |
| 213 | .stream = conn, | 213 | .stream = conn, |
| 214 | .writer = bufw, | 214 | .writer = bufw, |
| 215 | .reader = .init(conn), | 215 | .reader = .init(conn), |
| | 216 | .status = @enumFromInt(0), |
| 216 | .headers_raw = "", | 217 | .headers_raw = "", |
| 217 | }; | 218 | }; |
| 218 | } | 219 | } |
| ... | @@ -222,6 +223,7 @@ pub const ClientRequest = struct { | ... | @@ -222,6 +223,7 @@ pub const ClientRequest = struct { |
| 222 | stream: net.Stream, | 223 | stream: net.Stream, |
| 223 | writer: nio.BufferedWriter(4096, net.Stream), | 224 | writer: nio.BufferedWriter(4096, net.Stream), |
| 224 | reader: nio.BufferedReader(4096, net.Stream), | 225 | reader: nio.BufferedReader(4096, net.Stream), |
| | 226 | status: Status, |
| 225 | headers_raw: []const u8, | 227 | headers_raw: []const u8, |
| 226 | | 228 | |
| 227 | pub fn close(req: *const ClientRequest, allocator: std.mem.Allocator) void { | 229 | pub fn close(req: *const ClientRequest, allocator: std.mem.Allocator) void { |
| ... | @@ -257,6 +259,7 @@ pub const ClientRequest = struct { | ... | @@ -257,6 +259,7 @@ pub const ClientRequest = struct { |
| 257 | if (status.phrase()) |phrase| | 259 | if (status.phrase()) |phrase| |
| 258 | if (!std.mem.eql(u8, actual_phrase, phrase)) | 260 | if (!std.mem.eql(u8, actual_phrase, phrase)) |
| 259 | return error.Bad; | 261 | return error.Bad; |
| | 262 | req.status = status; |
| 260 | | 263 | |
| 261 | var headers_list = std.ArrayList(u8).init(req.allocator); | 264 | var headers_list = std.ArrayList(u8).init(req.allocator); |
| 262 | errdefer headers_list.deinit(); | 265 | errdefer headers_list.deinit(); |