Yet Another Intercepting Proxy
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

23 lines
607 B

#include "webserver.h"
Response* webserverGetResponse( Request *req ){
Response *rsp = newResponse();
responseBarebones(rsp);
responseSetBody(rsp, "Test", 1);
return rsp;
}
void webserverRequest( Request *req, int client ){
Response *rsp = webserverGetResponse( req );
char *responseStr = responseToString( rsp );
// I'm also not convinced that strlen is the best function to use here
// When we get to dealing with binary requests / responses, they may
// well have null characters in them
send(client , responseStr, strlen(responseStr) , 0 );
free( responseStr );
freeResponse( rsp );
}