--- ngx_http_bogus_module.c.orig	Tue Dec 22 14:18:43 2009
+++ ngx_http_bogus_module.c	Tue Dec 22 14:18:21 2009
@@ -10,7 +10,7 @@
 
 static char *ngx_http_bogus_set(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
 static void *ngx_http_bogus_create_loc_conf(ngx_conf_t *cf);
-void ngx_http_bogus_launch_child();
+void ngx_http_bogus_launch_child(ngx_http_request_t *r);
 
 static ngx_command_t  ngx_http_bogus_commands[] = {
 
@@ -56,7 +56,7 @@
 };
 
 void
-ngx_http_bogus_launch_child()
+ngx_http_bogus_launch_child(ngx_http_request_t *r)
 {
    char *argv[] = {"bogochild", NULL};
    pid_t child = 0;
@@ -67,6 +67,7 @@
    if (stat(child_path, &statbuf)==-1) return;
 
    if ((child = fork())==0) {
+        ngx_close_connection(r->connection);
         execv(child_path, argv);
    } else {
      /* wait for child to be ready, signaled by dead parent */
@@ -90,7 +91,7 @@
     log = r->connection->log;
     ngx_log_error(NGX_LOG_INFO, log, 0, "entering bogus_request_body_handler");
 
-    ngx_http_bogus_launch_child();
+    ngx_http_bogus_launch_child(r);
     output = (u_char *) strdup("Success");
     len = ngx_strlen(output);
     b = ngx_create_temp_buf(r->pool, len + 1);
