diff src/c/cgi.c @ 1094:db52c32dbe42

All three current protocols work with move to using uw_app
author Adam Chlipala <adamc@hcoop.net>
date Sun, 27 Dec 2009 10:37:24 -0500
parents 305bc0a431de
children 0cee0c8d8c37
line wrap: on
line diff
--- a/src/c/cgi.c	Sat Dec 26 11:56:40 2009 -0500
+++ b/src/c/cgi.c	Sun Dec 27 10:37:24 2009 -0500
@@ -5,8 +5,11 @@
 #include <unistd.h>
 #include <stdarg.h>
 
+#include "urweb.h"
 #include "request.h"
 
+extern uw_app uw_application;
+
 static char *uppercased;
 static size_t uppercased_len;
 
@@ -51,7 +54,7 @@
 }
 
 int main(int argc, char *argv[]) {
-  uw_context ctx = uw_request_new_context(NULL, log_error, log_debug);
+  uw_context ctx = uw_request_new_context(&uw_application, NULL, log_error, log_debug);
   uw_request_context rc = uw_new_request_context();
   request_result rr;
   char *method = getenv("REQUEST_METHOD"),
@@ -97,7 +100,7 @@
 
   uw_set_on_success("");
   uw_set_headers(ctx, get_header, NULL);
-  uw_request_init(NULL, log_error, log_debug);
+  uw_request_init(&uw_application, NULL, log_error, log_debug);
 
   body[body_pos] = 0;
   rr = uw_request(rc, ctx, method, path, query_string, body, body_pos,