diff src/c/cgi.c @ 1799:3d922a28370b

Basis.getenv
author Adam Chlipala <adam@chlipala.net>
date Thu, 02 Aug 2012 16:33:25 -0400
parents ea131de361d9
children 0da75c01a993
line wrap: on
line diff
--- a/src/c/cgi.c	Sun Jul 29 12:54:17 2012 -0400
+++ b/src/c/cgi.c	Thu Aug 02 16:33:25 2012 -0400
@@ -1,6 +1,7 @@
 #include "config.h"
 
 #include <stdio.h>
+#include <stdlib.h>
 #include <ctype.h>
 #include <string.h>
 #include <stdlib.h>
@@ -39,6 +40,10 @@
     return NULL;
 }
 
+static char *get_env(void *data, const char *name) {
+  return getenv(name);
+}
+
 static void on_success(uw_context ctx) { }
 
 static void on_failure(uw_context ctx) {
@@ -102,6 +107,7 @@
 
   uw_set_on_success("");
   uw_set_headers(ctx, get_header, NULL);
+  uw_set_env(ctx, get_env, NULL);
   uw_request_init(&uw_application, NULL, log_error, log_debug);
 
   body[body_pos] = 0;