diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-21 00:09:37 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2006-11-21 00:09:37 +0000 |
commit | fcdb00f7359488d197ac3361dfbc49ccdead8b87 (patch) | |
tree | f9dae67bb1b22c7249c24e20b7f4ae82ec824d52 /networking/httpd.c | |
parent | 6c85ddc8509e4b72ca5b4e47ca5085101a02f07c (diff) |
httpd: LC_TIME locale _must_ be POSIX to httpd! We speak over the net!
Diffstat (limited to 'networking/httpd.c')
-rw-r--r-- | networking/httpd.c | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/networking/httpd.c b/networking/httpd.c index afcd089b0..47d41a1e2 100644 --- a/networking/httpd.c +++ b/networking/httpd.c @@ -846,9 +846,11 @@ static int sendHeaders(HttpResponseNum responseNum) time_t timer = time(0); char timeStr[80]; int len; + enum { + numNames = sizeof(httpResponseNames) / sizeof(httpResponseNames[0]) + }; - for (i = 0; - i < (sizeof(httpResponseNames)/sizeof(httpResponseNames[0])); i++) { + for (i = 0; i < numNames; i++) { if (httpResponseNames[i].type == responseNum) { responseString = httpResponseNames[i].name; infoString = httpResponseNames[i].info; @@ -1177,7 +1179,7 @@ static int sendCgi(const char *url, # error "PIPESIZE >= MAX_MEMORY_BUFF" #endif - // There is something to read + /* There is something to read */ count = safe_read(inFd, rbuf, PIPESIZE); if (count == 0) break; /* closed */ @@ -1197,7 +1199,7 @@ static int sendCgi(const char *url, break; if (DEBUG) - fprintf(stderr, "cgi read %d bytes\n", count); + fprintf(stderr, "cgi read %d bytes: '%.*s'\n", count, count, rbuf); } } } @@ -1838,6 +1840,11 @@ int httpd_main(int argc, char *argv[]) USE_FEATURE_HTTPD_SETUID(struct bb_uidgid_t ugid;) USE_FEATURE_HTTPD_AUTH_MD5(const char *pass;) +#if ENABLE_LOCALE_SUPPORT + /* Undo busybox.c: we want to speak English in http (dates etc) */ + setlocale(LC_TIME, "C"); +#endif + config = xzalloc(sizeof(*config)); #if ENABLE_FEATURE_HTTPD_BASIC_AUTH config->realm = "Web Server Authentication"; |