diff options
author | Ziv Scully <ziv@mit.edu> | 2014-05-27 21:38:01 -0400 |
---|---|---|
committer | Ziv Scully <ziv@mit.edu> | 2014-05-27 21:38:01 -0400 |
commit | dc336268adfbf2b05b34ab006de5990f8ce9086c (patch) | |
tree | 22fb72ef5ad32f47571fa250515108188d7e22f9 /src/c/fastcgi.c | |
parent | d941d873c0203009ccf44aa4aed97671703ca375 (diff) | |
parent | 4cee29f03879d25963e3d8a8dda879e0a007033c (diff) |
Merge.
Diffstat (limited to 'src/c/fastcgi.c')
-rw-r--r-- | src/c/fastcgi.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/c/fastcgi.c b/src/c/fastcgi.c index 5c80d3ae..f3e66e3a 100644 --- a/src/c/fastcgi.c +++ b/src/c/fastcgi.c @@ -324,7 +324,8 @@ int fastcgi_send_normal(int sock, const void *buf, ssize_t len) { static void *worker(void *data) { FCGI_Input *in = fastcgi_input(); FCGI_Output *out = fastcgi_output(); - uw_context ctx = uw_request_new_context(*(int *)data, &uw_application, out, log_error, log_debug); + uw_loggers ls = {out, log_error, log_debug}; + uw_context ctx = uw_request_new_context(*(int *)data, &uw_application, &ls); uw_request_context rc = uw_new_request_context(); headers hs; size_t body_size = 0; @@ -514,7 +515,7 @@ static void sigint(int signum) { exit(0); } -static loggers ls = {&uw_application, NULL, log_error, log_debug}; +static uw_loggers ls = {NULL, log_error, log_debug}; int main(int argc, char *argv[]) { // The skeleton for this function comes from Beej's sockets tutorial. @@ -563,7 +564,7 @@ int main(int argc, char *argv[]) { } uw_set_on_success(""); - uw_request_init(&uw_application, NULL, log_error, log_debug); + uw_request_init(&uw_application, &ls); names = calloc(nthreads, sizeof(int)); @@ -572,7 +573,11 @@ int main(int argc, char *argv[]) { { pthread_t thread; - if (pthread_create_big(&thread, NULL, client_pruner, &ls)) { + pruner_data *pd = (pruner_data *)malloc(sizeof(pruner_data)); + pd->app = &uw_application; + pd->loggers = &ls; + + if (pthread_create_big(&thread, NULL, client_pruner, pd)) { fprintf(stderr, "Error creating pruner thread\n"); return 1; } |