Connection Flags Mixup
In lib/isc/httpd.c in function process_request()
an
HTTP request is parsed and the headers evaluated. When the client
sets two Connection
headers, the HTTPD_CLOSE
and
HTTPD_KEEPALIVE
flags might be set on httpd->flags
since they are not exclusive.
#define HTTPD_CLOSE 0x0001 /* Got a Connection: close header */
#define HTTPD_FOUNDHOST 0x0002 /* Got a Host: header */
#define HTTPD_KEEPALIVE 0x0004 /* Got a Connection: Keep-Alive */
...
} else if (name_match(header, "Connection")) {
if (value_match(header, "close")) {
httpd->flags |= HTTPD_CLOSE;
} else if (value_match(header, "keep-alive")) {
keep_alive = true;
}
...
switch (httpd->minor_version) {
case 0:
if (keep_alive == true) {
httpd->flags |= HTTPD_KEEPALIVE;
} else {
httpd->flags |= HTTPD_CLOSE;
}
break;
This currently has no impact but might lead to logic issues in the future when more features are added to the code.