summaryrefslogtreecommitdiff
path: root/networking
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2006-11-21 00:09:37 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2006-11-21 00:09:37 +0000
commitfcdb00f7359488d197ac3361dfbc49ccdead8b87 (patch)
treef9dae67bb1b22c7249c24e20b7f4ae82ec824d52 /networking
parent6c85ddc8509e4b72ca5b4e47ca5085101a02f07c (diff)
downloadbusybox-w32-fcdb00f7359488d197ac3361dfbc49ccdead8b87.tar.gz
busybox-w32-fcdb00f7359488d197ac3361dfbc49ccdead8b87.tar.bz2
busybox-w32-fcdb00f7359488d197ac3361dfbc49ccdead8b87.zip
httpd: LC_TIME locale _must_ be POSIX to httpd! We speak over the net!
Diffstat (limited to 'networking')
-rw-r--r--networking/httpd.c15
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)
846 time_t timer = time(0); 846 time_t timer = time(0);
847 char timeStr[80]; 847 char timeStr[80];
848 int len; 848 int len;
849 enum {
850 numNames = sizeof(httpResponseNames) / sizeof(httpResponseNames[0])
851 };
849 852
850 for (i = 0; 853 for (i = 0; i < numNames; i++) {
851 i < (sizeof(httpResponseNames)/sizeof(httpResponseNames[0])); i++) {
852 if (httpResponseNames[i].type == responseNum) { 854 if (httpResponseNames[i].type == responseNum) {
853 responseString = httpResponseNames[i].name; 855 responseString = httpResponseNames[i].name;
854 infoString = httpResponseNames[i].info; 856 infoString = httpResponseNames[i].info;
@@ -1177,7 +1179,7 @@ static int sendCgi(const char *url,
1177# error "PIPESIZE >= MAX_MEMORY_BUFF" 1179# error "PIPESIZE >= MAX_MEMORY_BUFF"
1178#endif 1180#endif
1179 1181
1180 // There is something to read 1182 /* There is something to read */
1181 count = safe_read(inFd, rbuf, PIPESIZE); 1183 count = safe_read(inFd, rbuf, PIPESIZE);
1182 if (count == 0) 1184 if (count == 0)
1183 break; /* closed */ 1185 break; /* closed */
@@ -1197,7 +1199,7 @@ static int sendCgi(const char *url,
1197 break; 1199 break;
1198 1200
1199 if (DEBUG) 1201 if (DEBUG)
1200 fprintf(stderr, "cgi read %d bytes\n", count); 1202 fprintf(stderr, "cgi read %d bytes: '%.*s'\n", count, count, rbuf);
1201 } 1203 }
1202 } 1204 }
1203 } 1205 }
@@ -1838,6 +1840,11 @@ int httpd_main(int argc, char *argv[])
1838 USE_FEATURE_HTTPD_SETUID(struct bb_uidgid_t ugid;) 1840 USE_FEATURE_HTTPD_SETUID(struct bb_uidgid_t ugid;)
1839 USE_FEATURE_HTTPD_AUTH_MD5(const char *pass;) 1841 USE_FEATURE_HTTPD_AUTH_MD5(const char *pass;)
1840 1842
1843#if ENABLE_LOCALE_SUPPORT
1844 /* Undo busybox.c: we want to speak English in http (dates etc) */
1845 setlocale(LC_TIME, "C");
1846#endif
1847
1841 config = xzalloc(sizeof(*config)); 1848 config = xzalloc(sizeof(*config));
1842#if ENABLE_FEATURE_HTTPD_BASIC_AUTH 1849#if ENABLE_FEATURE_HTTPD_BASIC_AUTH
1843 config->realm = "Web Server Authentication"; 1850 config->realm = "Web Server Authentication";