srctree

Jeremy Hertel parent 8126a6cf 44c6ba47
don't store allocator in response

src/response.zig added: 4, removed: 6, total 0
@@ -20,7 +20,6 @@ pub const TransferMode = enum {
proxy_streaming,
};
 
alloc: Allocator,
headers: Headers,
tranfer_mode: TransferMode = .static,
// This is just bad code, but I need to give the sane implementation more thought
@@ -33,7 +32,6 @@ status: ?std.http.Status = null,
 
pub fn init(a: Allocator, req: *const Request) !Response {
var self = Response{
.alloc = a,
.headers = Headers.init(a),
.cookie_jar = try Cookies.Jar.init(a),
};
 
src/verse.zig added: 4, removed: 6, total 0
@@ -210,11 +210,11 @@ pub fn quickStart(vrs: *Verse) NetworkError!void {
switch (vrs.downstream) {
.http => {
vrs.response.stdhttp.response = vrs.response.stdhttp.request.?.*.respondStreaming(.{
.send_buffer = vrs.response.alloc.alloc(u8, 0xffffff) catch unreachable,
.send_buffer = vrs.alloc.alloc(u8, 0xffffff) catch unreachable,
.respond_options = .{
.transfer_encoding = .chunked,
.keep_alive = false,
.extra_headers = @ptrCast(vrs.response.cookie_jar.toHeaderSlice(vrs.response.alloc) catch unreachable),
.extra_headers = @ptrCast(vrs.response.cookie_jar.toHeaderSlice(vrs.alloc) catch unreachable),
},
});