fix flexilib interface
This commit is contained in:
		
							parent
							
								
									05dd8b7e06
								
							
						
					
					
						commit
						983a1a6649
					
				
					 1 changed files with 8 additions and 5 deletions
				
			
		| 
						 | 
					@ -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" {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue