wget: add TODO
[oweals/busybox.git] / networking / httpd.c
index 08b40e014fdebd83cbfce2329b19204e1aac1783..986703d2d5a34d76c7bee2eadb2c34888e5ac4e9 100644 (file)
@@ -1036,6 +1036,9 @@ static int sendCgi(const char *url,
                setenv1("SCRIPT_FILENAME", realpath_buff);
                /* set SCRIPT_NAME as full path: /cgi-bin/dirs/script.cgi */
                setenv1("SCRIPT_NAME", purl);
+               /* TODO: bug 996 says we need to decodeString(config->query)
+                * before placing it into env. Is this true? Add example
+                * in the comment please... */
                setenv1("QUERY_STRING", config->query);
                setenv1("SERVER_SOFTWARE", httpdVersion);
                putenv("SERVER_PROTOCOL=HTTP/1.0");
@@ -1756,22 +1759,19 @@ static int miniHttpd(int server)
                /* set the KEEPALIVE option to cull dead connections */
                on = 1;
                setsockopt(s, SOL_SOCKET, SO_KEEPALIVE, (void *)&on, sizeof(on));
-#if !DEBUG
-               if (fork() == 0)
-#endif
-               {
-                       /* This is the spawned thread */
+
+               if (DEBUG || fork() == 0) {
+                       /* child */
 #if ENABLE_FEATURE_HTTPD_RELOAD_CONFIG_SIGHUP
                        /* protect reload config, may be confuse checking */
                        signal(SIGHUP, SIG_IGN);
 #endif
                        handleIncoming();
-#if !DEBUG
-                       exit(0);
-#endif
+                       if (!DEBUG)
+                               exit(0);
                }
                close(s);
-       } // while (1)
+       } /* while (1) */
        return 0;
 }