fix flexilib interface

This commit is contained in:
Emil Lerch 2023-10-23 13:55:36 -07:00
parent 05dd8b7e06
commit 983a1a6649
Signed by: lobo
GPG Key ID: A7B62D657EF764F8

View File

@ -59,14 +59,17 @@ export fn handle_request(request: *interface.Request) callconv(.C) ?*interface.R
// //
// handleRequest function here is the last line of boilerplate and the // handleRequest function here is the last line of boilerplate and the
// entry to a request // entry to a request
fn handleRequest(allocator: std.mem.Allocator, request: interface.ZigRequest, response: interface.ZigResponse) !void { fn handleRequest(allocator: std.mem.Allocator, response: *interface.ZigResponse) !void {
// setup // setup
var response_writer = response.body.writer(); var response_writer = response.body.writer();
// dispatch to our actual handler // dispatch to our actual handler
try response_writer.writeAll(try client_handler.handler(allocator, request.content, .{ .flexilib = .{ try response_writer.writeAll(try client_handler.handler(
.request = request, allocator,
.response = response, response.request.content,
} })); .{
.flexilib = response,
},
));
} }
// Need to figure out how tests would work // Need to figure out how tests would work
test "handle_request" { test "handle_request" {