<div dir="ltr"><div dir="ltr"><div>Inspired by the links below I added a limit of 8k for HTTP headers. If more a status of 413 Entity Too Large will be sent. Don't do explicit free anymore. Let all headers which start with HTTP_ be handled by the list creating code. This saves some space.<br></div><div dir="ltr"><div><br><a href="https://bugs.busybox.net/show_bug.cgi?id=9611" target="_blank">https://bugs.busybox.net/show_bug.cgi?id=9611</a><br><a href="https://stackoverflow.com/questions/686217/maximum-on-http-header-values" target="_blank">https://stackoverflow.com/questions/686217/maximum-on-http-header-values</a><br><a href="http://httpd.apache.org/docs/2.2/mod/core.html#limitrequestfieldsize" target="_blank">http://httpd.apache.org/docs/2.2/mod/core.html#limitrequestfieldsize</a></div><div><br></div><div>Bloatcheck:</div><div><div>function                                             old     new   delta</div><div>http_response                                        160     176     +16</div><div>http_response_type                                    20      22      +2</div><div>httpd_main                                           874     871      -3</div><div>send_file_and_exit                                   802     796      -6</div><div>send_headers                                        1004     992     -12</div><div>handle_incoming_and_exit                            2832    2737     -95</div><div>send_cgi_and_exit                                   1016     914    -102</div><div>.rodata                                           156610  156485    -125</div><div>------------------------------------------------------------------------------</div><div>(add/remove: 0/0 grow/shrink: 2/6 up/down: 18/-343)          Total: -325 bytes</div><div>   text<span style="white-space:pre-wrap">  </span>   data<span style="white-space:pre-wrap">       </span>    bss<span style="white-space:pre-wrap">       </span>    dec<span style="white-space:pre-wrap">       </span>    hex<span style="white-space:pre-wrap">       </span>filename</div><div>1012236<span style="white-space:pre-wrap">  </span>  17687<span style="white-space:pre-wrap">        </span>   1888<span style="white-space:pre-wrap">       </span>1031811<span style="white-space:pre-wrap"> </span>  fbe83<span style="white-space:pre-wrap">        </span>busybox_old</div><div>1011941<span style="white-space:pre-wrap">       </span>  17719<span style="white-space:pre-wrap">        </span>   1888<span style="white-space:pre-wrap">       </span>1031548<span style="white-space:pre-wrap"> </span>  fbd7c<span style="white-space:pre-wrap">        </span>busybox_unstripped</div></div><div><br></div><div><div>diff --git a/networking/httpd.c b/networking/httpd.c</div><div>index b52526a78..c27cd3001 100644</div><div>--- a/networking/httpd.c</div><div>+++ b/networking/httpd.c</div><div>@@ -267,6 +267,7 @@</div><div> #define DEBUG 0</div><div> </div><div> #define IOBUF_SIZE 8192</div><div>+#define MAX_HTTP_HEADER_SIZE (8*1024)</div><div> #if PIPE_BUF >= IOBUF_SIZE</div><div> # error "PIPE_BUF >= IOBUF_SIZE"</div><div> #endif</div><div>@@ -305,6 +306,12 @@ typedef struct Htaccess_Proxy {</div><div> <span style="white-space:pre-wrap">      </span>char *url_to;</div><div> } Htaccess_Proxy;</div><div> </div><div>+typedef struct HTTP_Header {</div><div>+    struct HTTP_Header *next;</div><div>+    char *name;</div><div>+    char *value;</div><div>+} HTTP_Header;</div><div>+</div><div> enum {</div><div> <span style="white-space:pre-wrap">    </span>HTTP_OK = 200,</div><div> <span style="white-space:pre-wrap"> </span>HTTP_PARTIAL_CONTENT = 206,</div><div>@@ -316,6 +323,7 @@ enum {</div><div> <span style="white-space:pre-wrap">   </span>HTTP_REQUEST_TIMEOUT = 408,</div><div> <span style="white-space:pre-wrap">    </span>HTTP_NOT_IMPLEMENTED = 501,   /* used for unrecognized requests */</div><div> <span style="white-space:pre-wrap">   </span>HTTP_INTERNAL_SERVER_ERROR = 500,</div><div>+<span style="white-space:pre-wrap">       </span>HTTP_ENTITY_TOO_LARGE = 413,</div><div> <span style="white-space:pre-wrap">   </span>HTTP_CONTINUE = 100,</div><div> #if 0   /* future use */</div><div> <span style="white-space:pre-wrap">        </span>HTTP_SWITCHING_PROTOCOLS = 101,</div><div>@@ -347,6 +355,7 @@ static const uint16_t http_response_type[] ALIGN2 = {</div><div> <span style="white-space:pre-wrap">        </span>HTTP_BAD_REQUEST,</div><div> <span style="white-space:pre-wrap">      </span>HTTP_FORBIDDEN,</div><div> <span style="white-space:pre-wrap">        </span>HTTP_INTERNAL_SERVER_ERROR,</div><div>+<span style="white-space:pre-wrap">     </span>HTTP_ENTITY_TOO_LARGE,</div><div> #if 0   /* not implemented */</div><div> <span style="white-space:pre-wrap"> </span>HTTP_CREATED,</div><div> <span style="white-space:pre-wrap">  </span>HTTP_ACCEPTED,</div><div>@@ -377,6 +386,7 @@ static const struct {</div><div> <span style="white-space:pre-wrap"> </span>{ "Bad Request", "Unsupported method" },</div><div> <span style="white-space:pre-wrap">   </span>{ "Forbidden", ""  },</div><div> <span style="white-space:pre-wrap">     </span>{ "Internal Server Error", "Internal Server Error" },</div><div>+<span style="white-space:pre-wrap">       </span>{ "Entity Too Large", "Entity Too Large" },</div><div> #if 0   /* not implemented */</div><div> <span style="white-space:pre-wrap">        </span>{ "Created" },</div><div> <span style="white-space:pre-wrap">       </span>{ "Accepted" },</div><div>@@ -412,11 +422,7 @@ struct globals {</div><div> </div><div> <span style="white-space:pre-wrap"> </span>IF_FEATURE_HTTPD_BASIC_AUTH(const char *g_realm;)</div><div> <span style="white-space:pre-wrap">      </span>IF_FEATURE_HTTPD_BASIC_AUTH(char *remoteuser;)</div><div>-<span style="white-space:pre-wrap">  </span>IF_FEATURE_HTTPD_CGI(char *referer;)</div><div>-<span style="white-space:pre-wrap">    </span>IF_FEATURE_HTTPD_CGI(char *user_agent;)</div><div>-<span style="white-space:pre-wrap"> </span>IF_FEATURE_HTTPD_CGI(char *host;)</div><div>-<span style="white-space:pre-wrap">       </span>IF_FEATURE_HTTPD_CGI(char *http_accept;)</div><div>-<span style="white-space:pre-wrap">        </span>IF_FEATURE_HTTPD_CGI(char *http_accept_language;)</div><div>+<span style="white-space:pre-wrap">       </span>IF_FEATURE_HTTPD_CGI(HTTP_Header *hdr_list;)</div><div> </div><div> <span style="white-space:pre-wrap">  </span>off_t file_size;        /* -1 - unknown */</div><div> #if ENABLE_FEATURE_HTTPD_RANGES</div><div>@@ -1437,7 +1443,6 @@ static void setenv1(const char *name, const char *value)</div><div>  * const char *url              The requested URL (with leading /).</div><div>  * const char *orig_uri         The original URI before rewriting (if any)</div><div>  * int post_len                 Length of the POST body.</div><div>- * const char *cookie           For set HTTP_COOKIE.</div><div>  * const char *content_type     For set CONTENT_TYPE.</div><div>  */</div><div> static void send_cgi_and_exit(</div><div>@@ -1445,14 +1450,12 @@ static void send_cgi_and_exit(</div><div> <span style="white-space:pre-wrap">            </span>const char *orig_uri,</div><div> <span style="white-space:pre-wrap">          </span>const char *request,</div><div> <span style="white-space:pre-wrap">           </span>int post_len,</div><div>-<span style="white-space:pre-wrap">           </span>const char *cookie,</div><div> <span style="white-space:pre-wrap">            </span>const char *content_type) NORETURN;</div><div> static void send_cgi_and_exit(</div><div> <span style="white-space:pre-wrap">             </span>const char *url,</div><div> <span style="white-space:pre-wrap">               </span>const char *orig_uri,</div><div> <span style="white-space:pre-wrap">          </span>const char *request,</div><div> <span style="white-space:pre-wrap">           </span>int post_len,</div><div>-<span style="white-space:pre-wrap">           </span>const char *cookie,</div><div> <span style="white-space:pre-wrap">            </span>const char *content_type)</div><div> {</div><div> <span style="white-space:pre-wrap">    </span>struct fd_pair fromCgi;  /* CGI -> httpd pipe */</div><div>@@ -1531,15 +1534,8 @@ static void send_cgi_and_exit(</div><div> #endif</div><div> <span style="white-space:pre-wrap">                </span>}</div><div> <span style="white-space:pre-wrap">      </span>}</div><div>-<span style="white-space:pre-wrap">       </span>setenv1("HTTP_USER_AGENT", G.user_agent);</div><div>-<span style="white-space:pre-wrap">     </span>if (G.http_accept)</div><div>-<span style="white-space:pre-wrap">              </span>setenv1("HTTP_ACCEPT", G.http_accept);</div><div>-<span style="white-space:pre-wrap">        </span>if (G.http_accept_language)</div><div>-<span style="white-space:pre-wrap">             </span>setenv1("HTTP_ACCEPT_LANGUAGE", G.http_accept_language);</div><div> <span style="white-space:pre-wrap">     </span>if (post_len)</div><div> <span style="white-space:pre-wrap">          </span>putenv(xasprintf("CONTENT_LENGTH=%u", post_len));</div><div>-<span style="white-space:pre-wrap">     </span>if (cookie)</div><div>-<span style="white-space:pre-wrap">             </span>setenv1("HTTP_COOKIE", cookie);</div><div> <span style="white-space:pre-wrap">      </span>if (content_type)</div><div> <span style="white-space:pre-wrap">              </span>setenv1("CONTENT_TYPE", content_type);</div><div> #if ENABLE_FEATURE_HTTPD_BASIC_AUTH</div><div>@@ -1548,12 +1544,17 @@ static void send_cgi_and_exit(</div><div> <span style="white-space:pre-wrap">              </span>putenv((char*)"AUTH_TYPE=Basic");</div><div> <span style="white-space:pre-wrap">    </span>}</div><div> #endif</div><div>-<span style="white-space:pre-wrap">        </span>if (G.referer)</div><div>-<span style="white-space:pre-wrap">          </span>setenv1("HTTP_REFERER", G.referer);</div><div>-<span style="white-space:pre-wrap">   </span>setenv1("HTTP_HOST", G.host); /* set to "" if NULL */</div><div> <span style="white-space:pre-wrap">      </span>/* setenv1("SERVER_NAME", safe_gethostname()); - don't do this,</div><div> <span style="white-space:pre-wrap">  </span> * just run "env SERVER_NAME=xyz httpd ..." instead */</div><div> </div><div>+<span style="white-space:pre-wrap">       </span>if (G.hdr_list) {</div><div>+<span style="white-space:pre-wrap">               </span>HTTP_Header *cur = G.hdr_list;</div><div>+<span style="white-space:pre-wrap">          </span>do {</div><div>+<span style="white-space:pre-wrap">                    </span>setenv1(cur->name, cur->value);</div><div>+<span style="white-space:pre-wrap">                   </span>cur = cur->next;</div><div>+<span style="white-space:pre-wrap">             </span>} while (cur != G.hdr_list);</div><div>+<span style="white-space:pre-wrap">    </span>}</div><div>+</div><div> <span style="white-space:pre-wrap">      </span>xpiped_pair(fromCgi);</div><div> <span style="white-space:pre-wrap">  </span>xpiped_pair(toCgi);</div><div> </div><div>@@ -2077,12 +2078,13 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr)</div><div> <span style="white-space:pre-wrap">      </span>char *urlcopy;</div><div> <span style="white-space:pre-wrap"> </span>char *urlp;</div><div> <span style="white-space:pre-wrap">    </span>char *tptr;</div><div>+<span style="white-space:pre-wrap">     </span>int hdr_len = 0;</div><div> #if ENABLE_FEATURE_HTTPD_CGI</div><div> <span style="white-space:pre-wrap">  </span>static const char request_HEAD[] ALIGN1 = "HEAD";</div><div> <span style="white-space:pre-wrap">    </span>const char *prequest;</div><div>-<span style="white-space:pre-wrap">   </span>char *cookie = NULL;</div><div> <span style="white-space:pre-wrap">   </span>char *content_type = NULL;</div><div> <span style="white-space:pre-wrap">     </span>unsigned long length = 0;</div><div>+<span style="white-space:pre-wrap">       </span>HTTP_Header *last = NULL;</div><div> #elif ENABLE_FEATURE_HTTPD_PROXY</div><div> #define prequest request_GET</div><div> <span style="white-space:pre-wrap">        </span>unsigned long length = 0;</div><div>@@ -2263,8 +2265,11 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr)</div><div> </div><div> <span style="white-space:pre-wrap">         </span>/* Read until blank line */</div><div> <span style="white-space:pre-wrap">            </span>while (1) {</div><div>-<span style="white-space:pre-wrap">                     </span>if (!get_line())</div><div>+<span style="white-space:pre-wrap">                        </span>int iobuf_len = get_line();</div><div>+<span style="white-space:pre-wrap">                     </span>if (!iobuf_len)</div><div> <span style="white-space:pre-wrap">                                </span>break; /* EOF or error or empty line */</div><div>+<span style="white-space:pre-wrap">                 </span>if ((hdr_len += iobuf_len) > MAX_HTTP_HEADER_SIZE)</div><div>+<span style="white-space:pre-wrap">                           </span>send_headers_and_exit(HTTP_ENTITY_TOO_LARGE);</div><div> <span style="white-space:pre-wrap">                  </span>if (DEBUG)</div><div> <span style="white-space:pre-wrap">                             </span>bb_error_msg("header: '%s'", iobuf);</div><div> </div><div>@@ -2301,32 +2306,8 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr)</div><div> <span style="white-space:pre-wrap">                            </span>}</div><div> <span style="white-space:pre-wrap">                      </span>}</div><div> #endif</div><div>-#if ENABLE_FEATURE_HTTPD_CGI</div><div>-<span style="white-space:pre-wrap">                    </span>else if (STRNCASECMP(iobuf, "Cookie:") == 0) {</div><div>-<span style="white-space:pre-wrap">                                </span>if (!cookie) /* in case they send millions of these, do not OOM */</div><div>-<span style="white-space:pre-wrap">                                      </span>cookie = xstrdup(skip_whitespace(iobuf + sizeof("Cookie:")-1));</div><div>-<span style="white-space:pre-wrap">                       </span>} else if (STRNCASECMP(iobuf, "Content-Type:") == 0) {</div><div>-<span style="white-space:pre-wrap">                                </span>if (!content_type)</div><div>-<span style="white-space:pre-wrap">                                      </span>content_type = xstrdup(skip_whitespace(iobuf + sizeof("Content-Type:")-1));</div><div>-<span style="white-space:pre-wrap">                   </span>} else if (STRNCASECMP(iobuf, "Referer:") == 0) {</div><div>-<span style="white-space:pre-wrap">                             </span>if (!G.referer)</div><div>-<span style="white-space:pre-wrap">                                 </span>G.referer = xstrdup(skip_whitespace(iobuf + sizeof("Referer:")-1));</div><div>-<span style="white-space:pre-wrap">                   </span>} else if (STRNCASECMP(iobuf, "User-Agent:") == 0) {</div><div>-<span style="white-space:pre-wrap">                          </span>if (!G.user_agent)</div><div>-<span style="white-space:pre-wrap">                                      </span>G.user_agent = xstrdup(skip_whitespace(iobuf + sizeof("User-Agent:")-1));</div><div>-<span style="white-space:pre-wrap">                     </span>} else if (STRNCASECMP(iobuf, "Host:") == 0) {</div><div>-<span style="white-space:pre-wrap">                                </span>if (!G.host)</div><div>-<span style="white-space:pre-wrap">                                    </span>G.host = xstrdup(skip_whitespace(iobuf + sizeof("Host:")-1));</div><div>-<span style="white-space:pre-wrap">                 </span>} else if (STRNCASECMP(iobuf, "Accept:") == 0) {</div><div>-<span style="white-space:pre-wrap">                              </span>if (!G.http_accept)</div><div>-<span style="white-space:pre-wrap">                                     </span>G.http_accept = xstrdup(skip_whitespace(iobuf + sizeof("Accept:")-1));</div><div>-<span style="white-space:pre-wrap">                        </span>} else if (STRNCASECMP(iobuf, "Accept-Language:") == 0) {</div><div>-<span style="white-space:pre-wrap">                             </span>if (!G.http_accept_language)</div><div>-<span style="white-space:pre-wrap">                                    </span>G.http_accept_language = xstrdup(skip_whitespace(iobuf + sizeof("Accept-Language:")-1));</div><div>-<span style="white-space:pre-wrap">                      </span>}</div><div>-#endif</div><div> #if ENABLE_FEATURE_HTTPD_BASIC_AUTH</div><div>-<span style="white-space:pre-wrap">                     </span>if (STRNCASECMP(iobuf, "Authorization:") == 0) {</div><div>+<span style="white-space:pre-wrap">                      </span>else if (STRNCASECMP(iobuf, "Authorization:") == 0) {</div><div> <span style="white-space:pre-wrap">                                </span>/* We only allow Basic credentials.</div><div> <span style="white-space:pre-wrap">                            </span> * It shows up as "Authorization: Basic <user>:<passwd>" where</div><div> <span style="white-space:pre-wrap">                           </span> * "<user>:<passwd>" is base64 encoded.</div><div>@@ -2341,7 +2322,7 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr)</div><div> <span style="white-space:pre-wrap">                       </span>}</div><div> #endif</div><div> #if ENABLE_FEATURE_HTTPD_RANGES</div><div>-<span style="white-space:pre-wrap">                        </span>if (STRNCASECMP(iobuf, "Range:") == 0) {</div><div>+<span style="white-space:pre-wrap">                      </span>else if (STRNCASECMP(iobuf, "Range:") == 0) {</div><div> <span style="white-space:pre-wrap">                                </span>/* We know only bytes=NNN-[MMM] */</div><div> <span style="white-space:pre-wrap">                             </span>char *s = skip_whitespace(iobuf + sizeof("Range:")-1);</div><div> <span style="white-space:pre-wrap">                               </span>if (is_prefixed_with(s, "bytes=")) {</div><div>@@ -2358,7 +2339,7 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr)</div><div> <span style="white-space:pre-wrap">                      </span>}</div><div> #endif</div><div> #if ENABLE_FEATURE_HTTPD_GZIP</div><div>-<span style="white-space:pre-wrap">                  </span>if (STRNCASECMP(iobuf, "Accept-Encoding:") == 0) {</div><div>+<span style="white-space:pre-wrap">                    </span>else if (STRNCASECMP(iobuf, "Accept-Encoding:") == 0) {</div><div> <span style="white-space:pre-wrap">                              </span>/* Note: we do not support "gzip;q=0"</div><div> <span style="white-space:pre-wrap">                                </span> * method of _disabling_ gzip</div><div> <span style="white-space:pre-wrap">                          </span> * delivery. No one uses that, though */</div><div>@@ -2373,6 +2354,46 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr)</div><div> <span style="white-space:pre-wrap">                                   </span>//}</div><div> <span style="white-space:pre-wrap">                            </span>}</div><div> <span style="white-space:pre-wrap">                      </span>}</div><div>+#endif</div><div>+#if ENABLE_FEATURE_HTTPD_CGI</div><div>+<span style="white-space:pre-wrap">                     </span>else if (STRNCASECMP(iobuf, "Content-Type:") == 0) {</div><div>+<span style="white-space:pre-wrap">                          </span>if (!content_type)</div><div>+<span style="white-space:pre-wrap">                                      </span>content_type = xstrdup(skip_whitespace(iobuf + sizeof("Content-Type:")-1));</div><div>+<span style="white-space:pre-wrap">                   </span>} else {</div><div>+<span style="white-space:pre-wrap">                                </span>HTTP_Header *cur;</div><div>+<span style="white-space:pre-wrap">                               </span>char *after_colon = strchr(iobuf, ':');</div><div>+<span style="white-space:pre-wrap">                         </span>char *ch = iobuf;</div><div>+</div><div>+<span style="white-space:pre-wrap">                               </span>if (!after_colon)</div><div>+<span style="white-space:pre-wrap">                                       </span>continue;</div><div>+</div><div>+<span style="white-space:pre-wrap">                               </span>cur = xmalloc(sizeof(HTTP_Header));</div><div>+<span style="white-space:pre-wrap">                             </span>*after_colon++ = '\0';</div><div>+</div><div>+<span style="white-space:pre-wrap">                          </span>while (*ch) {</div><div>+<span style="white-space:pre-wrap">                                   </span>if (isalpha(*ch))</div><div>+<span style="white-space:pre-wrap">                                               </span>*ch &= ~0x20;</div><div>+<span style="white-space:pre-wrap">                                       </span>else if (!isdigit(*ch))</div><div>+<span style="white-space:pre-wrap">                                         </span>*ch = '_';</div><div>+<span style="white-space:pre-wrap">                                      </span>ch++;</div><div>+<span style="white-space:pre-wrap">                           </span>}</div><div>+</div><div>+<span style="white-space:pre-wrap">                               </span>cur->name = xmalloc(sizeof("HTTP_")+strlen(iobuf));</div><div>+<span style="white-space:pre-wrap">                                </span>memcpy(cur->name, "HTTP_", sizeof("HTTP_")-1);</div><div>+<span style="white-space:pre-wrap">                           </span>strcpy(cur->name + sizeof("HTTP_")-1, iobuf);</div><div>+<span style="white-space:pre-wrap">                              </span>cur->value = xstrdup(skip_whitespace(after_colon));</div><div>+</div><div>+<span style="white-space:pre-wrap">                          </span>/* Insert new header into header list */</div><div>+<span style="white-space:pre-wrap">                                </span>if (!G.hdr_list) {</div><div>+<span style="white-space:pre-wrap">                                      </span>G.hdr_list = cur;</div><div>+<span style="white-space:pre-wrap">                                       </span>cur->next = G.hdr_list;</div><div>+<span style="white-space:pre-wrap">                                      </span>last = cur;</div><div>+<span style="white-space:pre-wrap">                             </span>} else {</div><div>+<span style="white-space:pre-wrap">                                        </span>cur->next = G.hdr_list;</div><div>+<span style="white-space:pre-wrap">                                      </span>last->next = cur;</div><div>+<span style="white-space:pre-wrap">                                    </span>last = cur;</div><div>+<span style="white-space:pre-wrap">                             </span>}</div><div>+<span style="white-space:pre-wrap">                       </span>}</div><div> #endif</div><div> <span style="white-space:pre-wrap">               </span>} /* while extra header reading */</div><div> <span style="white-space:pre-wrap">     </span>}</div><div>@@ -2435,7 +2456,7 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr)</div><div> <span style="white-space:pre-wrap">                   </span>/* protect listing "cgi-bin/" */</div><div> <span style="white-space:pre-wrap">                     </span>send_headers_and_exit(HTTP_FORBIDDEN);</div><div> <span style="white-space:pre-wrap">         </span>}</div><div>-<span style="white-space:pre-wrap">               </span>send_cgi_and_exit(urlcopy, urlcopy, prequest, length, cookie, content_type);</div><div>+<span style="white-space:pre-wrap">            </span>send_cgi_and_exit(urlcopy, urlcopy, prequest, length, content_type);</div><div> <span style="white-space:pre-wrap">   </span>}</div><div> #endif</div><div> </div><div>@@ -2456,7 +2477,7 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr)</div><div> <span style="white-space:pre-wrap">                   </span>Htaccess *cur;</div><div> <span style="white-space:pre-wrap">                 </span>for (cur = script_i; cur; cur = cur->next) {</div><div> <span style="white-space:pre-wrap">                                </span>if (strcmp(cur->before_colon + 1, suffix) == 0) {</div><div>-<span style="white-space:pre-wrap">                                    </span>send_cgi_and_exit(urlcopy, urlcopy, prequest, length, cookie, content_type);</div><div>+<span style="white-space:pre-wrap">                                    </span>send_cgi_and_exit(urlcopy, urlcopy, prequest, length, content_type);</div><div> <span style="white-space:pre-wrap">                           </span>}</div><div> <span style="white-space:pre-wrap">                      </span>}</div><div> <span style="white-space:pre-wrap">              </span>}</div><div>@@ -2470,7 +2491,7 @@ static void handle_incoming_and_exit(const len_and_sockaddr *fromAddr)</div><div> <span style="white-space:pre-wrap">           </span> * Try cgi-bin/index.cgi */</div><div> <span style="white-space:pre-wrap">            </span>if (access("/cgi-bin/index.cgi"+1, X_OK) == 0) {</div><div> <span style="white-space:pre-wrap">                     </span>urlp[0] = '\0'; /* remove index_page */</div><div>-<span style="white-space:pre-wrap">                 </span>send_cgi_and_exit("/cgi-bin/index.cgi", urlcopy, prequest, length, cookie, content_type);</div><div>+<span style="white-space:pre-wrap">                     </span>send_cgi_and_exit("/cgi-bin/index.cgi", urlcopy, prequest, length, content_type);</div><div> <span style="white-space:pre-wrap">            </span>}</div><div> <span style="white-space:pre-wrap">      </span>}</div><div> <span style="white-space:pre-wrap">      </span>/* else fall through to send_file, it errors out if open fails: */</div></div><div><br></div></div></div></div>