httpd: CGI Status: header fix
authorDenis Vlasenko <vda.linux@googlemail.com>
Sat, 11 Aug 2007 20:26:02 +0000 (20:26 -0000)
committerDenis Vlasenko <vda.linux@googlemail.com>
Sat, 11 Aug 2007 20:26:02 +0000 (20:26 -0000)
networking/httpd.c

index 2f76828c62741c7a8910d4937d32831296e1c92e..fb3129f0b39b3aa0fd2bcb09eb6e48169b2bf692 100644 (file)
@@ -1287,15 +1287,13 @@ static int sendCgi(const char *url,
                                buf_count += count;
                                count = 0;
                                /* "Status" header format is: "Status: 302 Redirected\r\n" */
-                               if (buf_count >= 8) {
-                                       if (memcmp(rbuf, "Status: ", 8) == 0) {
-                                               /* send "HTTP/1.0 " */
-                                               if (full_write(s, HTTP_200, 9) != 9)
-                                                       break;
-                                               rbuf += 8; /* skip "Status: " */
-                                               count -= 8;
-                                               buf_count = -1; /* buffering off */
-                                       }
+                               if (buf_count >= 8 && memcmp(rbuf, "Status: ", 8) == 0) {
+                                       /* send "HTTP/1.0 " */
+                                       if (full_write(s, HTTP_200, 9) != 9)
+                                               break;
+                                       rbuf += 8; /* skip "Status: " */
+                                       count = buf_count - 8;
+                                       buf_count = -1; /* buffering off */
                                } else if (buf_count >= 4) {
                                        /* Did CGI add "HTTP"? */
                                        if (memcmp(rbuf, HTTP_200, 4) != 0) {