diff options
author | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-08-29 15:53:23 +0000 |
---|---|---|
committer | bug1 <bug1@69ca8d6d-28ef-0310-b511-8ec308f3f277> | 2003-08-29 15:53:23 +0000 |
commit | 6d740c9dd208f0461ffa87d64d97f0c555648d08 (patch) | |
tree | ae4e99ee1f605df5cc2215f7c4a2a0709f6325b2 | |
parent | 1ab5a4a59e8639851a4ced9261943e60040ab3bc (diff) | |
download | busybox-w32-6d740c9dd208f0461ffa87d64d97f0c555648d08.tar.gz busybox-w32-6d740c9dd208f0461ffa87d64d97f0c555648d08.tar.bz2 busybox-w32-6d740c9dd208f0461ffa87d64d97f0c555648d08.zip |
"Due to a wrong format parameter in a printf httpd does not work when
compiled for with CONFIG_LFS (large file support).
The attached patch suggested by Vladimir fixes that." - Steven Scholz
git-svn-id: svn://busybox.net/trunk/busybox@7292 69ca8d6d-28ef-0310-b511-8ec308f3f277
-rw-r--r-- | networking/httpd.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index d58414b55..8c87e7e91 100644 --- a/networking/httpd.c +++ b/networking/httpd.c | |||
@@ -127,6 +127,13 @@ static const char default_path_httpd_conf[] = "/etc"; | |||
127 | static const char httpd_conf[] = "httpd.conf"; | 127 | static const char httpd_conf[] = "httpd.conf"; |
128 | static const char home[] = "./"; | 128 | static const char home[] = "./"; |
129 | 129 | ||
130 | #ifdef CONFIG_LFS | ||
131 | # define cont_l_fmt "%lld" | ||
132 | #else | ||
133 | # define cont_l_fmt "%ld" | ||
134 | #endif | ||
135 | |||
136 | |||
130 | // Note: bussybox xfuncs are not used because we want the server to keep running | 137 | // Note: bussybox xfuncs are not used because we want the server to keep running |
131 | // if something bad happens due to a malformed user request. | 138 | // if something bad happens due to a malformed user request. |
132 | // As a result, all memory allocation after daemonize | 139 | // As a result, all memory allocation after daemonize |
@@ -932,7 +939,7 @@ static int sendHeaders(HttpResponseNum responseNum) | |||
932 | #endif | 939 | #endif |
933 | if (config->ContentLength != -1) { /* file */ | 940 | if (config->ContentLength != -1) { /* file */ |
934 | strftime(timeStr, sizeof(timeStr), RFC1123FMT, gmtime(&config->last_mod)); | 941 | strftime(timeStr, sizeof(timeStr), RFC1123FMT, gmtime(&config->last_mod)); |
935 | len += sprintf(buf+len, "Last-Modified: %s\r\n%s %ld\r\n", | 942 | len += sprintf(buf+len, "Last-Modified: %s\r\n%s " cont_l_fmt "\r\n", |
936 | timeStr, Content_length, config->ContentLength); | 943 | timeStr, Content_length, config->ContentLength); |
937 | } | 944 | } |
938 | strcat(buf, "\r\n"); | 945 | strcat(buf, "\r\n"); |