mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-08-30 22:15:20 +00:00
4188. [bug] Support HTTP/1.0 client properly on the statistics
channel. [RT #40261]
This commit is contained in:
3
CHANGES
3
CHANGES
@@ -1,3 +1,6 @@
|
|||||||
|
4188. [bug] Support HTTP/1.0 client properly on the statistics
|
||||||
|
channel. [RT #40261]
|
||||||
|
|
||||||
4187. [func] When any RR type implementation doesn't
|
4187. [func] When any RR type implementation doesn't
|
||||||
implement totext() for the RDATA's wire
|
implement totext() for the RDATA's wire
|
||||||
representation and returns ISC_R_NOTIMPLEMENTED,
|
representation and returns ISC_R_NOTIMPLEMENTED,
|
||||||
|
@@ -62,6 +62,7 @@
|
|||||||
|
|
||||||
#define HTTPD_CLOSE 0x0001 /* Got a Connection: close header */
|
#define HTTPD_CLOSE 0x0001 /* Got a Connection: close header */
|
||||||
#define HTTPD_FOUNDHOST 0x0002 /* Got a Host: header */
|
#define HTTPD_FOUNDHOST 0x0002 /* Got a Host: header */
|
||||||
|
#define HTTPD_KEEPALIVE 0x0004 /* Got a Connection: Keep-Alive */
|
||||||
|
|
||||||
/*% http client */
|
/*% http client */
|
||||||
struct isc_httpd {
|
struct isc_httpd {
|
||||||
@@ -483,6 +484,13 @@ process_request(isc_httpd_t *httpd, int length) {
|
|||||||
if (strstr(s, "Host: ") != NULL)
|
if (strstr(s, "Host: ") != NULL)
|
||||||
httpd->flags |= HTTPD_FOUNDHOST;
|
httpd->flags |= HTTPD_FOUNDHOST;
|
||||||
|
|
||||||
|
if (strncmp(httpd->protocol, "HTTP/1.0", 8) == 0) {
|
||||||
|
if (strcasestr(s, "Connection: Keep-Alive") != NULL)
|
||||||
|
httpd->flags |= HTTPD_KEEPALIVE;
|
||||||
|
else
|
||||||
|
httpd->flags |= HTTPD_CLOSE;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Standards compliance hooks here.
|
* Standards compliance hooks here.
|
||||||
*/
|
*/
|
||||||
@@ -597,7 +605,7 @@ render_404(const char *url, isc_httpdurl_t *urlinfo,
|
|||||||
const char **mimetype, isc_buffer_t *b,
|
const char **mimetype, isc_buffer_t *b,
|
||||||
isc_httpdfree_t **freecb, void **freecb_args)
|
isc_httpdfree_t **freecb, void **freecb_args)
|
||||||
{
|
{
|
||||||
static char msg[] = "No such URL.";
|
static char msg[] = "No such URL.\r\n";
|
||||||
|
|
||||||
UNUSED(url);
|
UNUSED(url);
|
||||||
UNUSED(urlinfo);
|
UNUSED(urlinfo);
|
||||||
@@ -623,7 +631,7 @@ render_500(const char *url, isc_httpdurl_t *urlinfo,
|
|||||||
const char **mimetype, isc_buffer_t *b,
|
const char **mimetype, isc_buffer_t *b,
|
||||||
isc_httpdfree_t **freecb, void **freecb_args)
|
isc_httpdfree_t **freecb, void **freecb_args)
|
||||||
{
|
{
|
||||||
static char msg[] = "Internal server failure.";
|
static char msg[] = "Internal server failure.\r\n";
|
||||||
|
|
||||||
UNUSED(url);
|
UNUSED(url);
|
||||||
UNUSED(urlinfo);
|
UNUSED(urlinfo);
|
||||||
@@ -726,6 +734,8 @@ isc_httpd_recvdone(isc_task_t *task, isc_event_t *ev) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
isc_httpd_response(httpd);
|
isc_httpd_response(httpd);
|
||||||
|
if ((httpd->flags & HTTPD_KEEPALIVE) != 0)
|
||||||
|
isc_httpd_addheader(httpd, "Connection", "Keep-Alive");
|
||||||
isc_httpd_addheader(httpd, "Content-Type", httpd->mimetype);
|
isc_httpd_addheader(httpd, "Content-Type", httpd->mimetype);
|
||||||
isc_httpd_addheader(httpd, "Date", datebuf);
|
isc_httpd_addheader(httpd, "Date", datebuf);
|
||||||
isc_httpd_addheader(httpd, "Expires", datebuf);
|
isc_httpd_addheader(httpd, "Expires", datebuf);
|
||||||
|
Reference in New Issue
Block a user