aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-08-11 20:26:02 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-08-11 20:26:02 +0000
commit4185548984357df91311f30c8e43d95f33922576 (patch)
tree204b61d79f06ce3a6d45d12db92aa2a8f7a8b3db
parent1ec15cd818be3afe9c3f3e1b251937cf119d6add (diff)
downloadbusybox-w32-4185548984357df91311f30c8e43d95f33922576.tar.gz
busybox-w32-4185548984357df91311f30c8e43d95f33922576.tar.bz2
busybox-w32-4185548984357df91311f30c8e43d95f33922576.zip
httpd: CGI Status: header fix
-rw-r--r--networking/httpd.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/networking/httpd.c b/networking/httpd.c
index 2f76828c6..fb3129f0b 100644
--- a/networking/httpd.c
+++ b/networking/httpd.c
@@ -1287,15 +1287,13 @@ static int sendCgi(const char *url,
1287 buf_count += count; 1287 buf_count += count;
1288 count = 0; 1288 count = 0;
1289 /* "Status" header format is: "Status: 302 Redirected\r\n" */ 1289 /* "Status" header format is: "Status: 302 Redirected\r\n" */
1290 if (buf_count >= 8) { 1290 if (buf_count >= 8 && memcmp(rbuf, "Status: ", 8) == 0) {
1291 if (memcmp(rbuf, "Status: ", 8) == 0) { 1291 /* send "HTTP/1.0 " */
1292 /* send "HTTP/1.0 " */ 1292 if (full_write(s, HTTP_200, 9) != 9)
1293 if (full_write(s, HTTP_200, 9) != 9) 1293 break;
1294 break; 1294 rbuf += 8; /* skip "Status: " */
1295 rbuf += 8; /* skip "Status: " */ 1295 count = buf_count - 8;
1296 count -= 8; 1296 buf_count = -1; /* buffering off */
1297 buf_count = -1; /* buffering off */
1298 }
1299 } else if (buf_count >= 4) { 1297 } else if (buf_count >= 4) {
1300 /* Did CGI add "HTTP"? */ 1298 /* Did CGI add "HTTP"? */
1301 if (memcmp(rbuf, HTTP_200, 4) != 0) { 1299 if (memcmp(rbuf, HTTP_200, 4) != 0) {