diff options
author | Denis Vlasenko | 2008-02-08 15:21:55 +0000 |
---|---|---|
committer | Denis Vlasenko | 2008-02-08 15:21:55 +0000 |
commit | 7dbf1b4d9eb0eca9c98cfdd0d37d6ce3b8f09e0c (patch) | |
tree | dd01374382cb0e98b1e508dfd864224f211c4a78 | |
parent | afdad653ac62e99d8da30e441d3414684146db19 (diff) | |
download | busybox-7dbf1b4d9eb0eca9c98cfdd0d37d6ce3b8f09e0c.zip busybox-7dbf1b4d9eb0eca9c98cfdd0d37d6ce3b8f09e0c.tar.gz |
httpd: add a bit of error logging; a few code simplifications. +29 bytes.
-rw-r--r-- | networking/httpd.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index 0f18b0f..3ac9b90 100644 --- a/networking/httpd.c +++ b/networking/httpd.c @@ -1419,8 +1419,9 @@ static void send_cgi_and_exit( /* script must have absolute path */ script = strrchr(fullpath, '/'); - if (!script) - goto error_execing_cgi; + //fullpath is a result of concat_path_file and always has '/' + //if (!script) + // goto error_execing_cgi; *script = '\0'; /* chdiring to script's dir */ if (chdir(fullpath) == 0) { @@ -1441,16 +1442,19 @@ static void send_cgi_and_exit( #endif *script = '/'; /* set argv[0] to name without path */ - argv[0] = (char*)bb_basename(purl); + argv[0] = script + 1; argv[1] = NULL; #if ENABLE_FEATURE_HTTPD_CONFIG_WITH_SCRIPT_INTERPR if (interpr) - execv(interpr, argv); - else + fullpath = interpr; #endif - execv(fullpath, argv); + execv(fullpath, argv); + if (verbose) + bb_perror_msg("exec %s", fullpath); + } else if (verbose) { + bb_perror_msg("chdir %s", fullpath); } - error_execing_cgi: + //error_execing_cgi: /* send to stdout * (we are CGI here, our stdout is pumped to the net) */ send_headers_and_exit(HTTP_NOT_FOUND); |