add perl wrapper to scgi

This commit is contained in:
Anthony Minessale
2012-05-23 09:37:54 -05:00
parent a5cd951c53
commit bb3f72cb66
12 changed files with 7025 additions and 30 deletions

View File

@@ -1,12 +1,14 @@
#include <scgi.h>
static void callback(scgi_socket_t server_sock, scgi_socket_t client_sock, struct sockaddr_in *addr)
static void callback(scgi_socket_t server_sock, scgi_socket_t *client_sock, struct sockaddr_in *addr)
{
scgi_handle_t handle = { 0 };
if (scgi_parse(client_sock, &handle) == SCGI_SUCCESS) {
scgi_param_t *pp;
*client_sock = SCGI_SOCK_INVALID;
for(pp = handle.params; pp; pp = pp->next) {
printf("HEADER: [%s] VALUE: [%s]\n", pp->name, pp->value);
}
@@ -15,10 +17,9 @@ static void callback(scgi_socket_t server_sock, scgi_socket_t client_sock, struc
printf("\n\nBODY:\n%s\n\n", handle.body);
}
scgi_disconnect(&handle);
}
scgi_disconnect(&handle);
}
int main(int argc, char *argv[])