From b5a24b1d4fe827e0fd59347484f30ab900c7c694 Mon Sep 17 00:00:00 2001 From: Takashi Sato Date: Sun, 22 Nov 2009 14:30:50 +0000 Subject: [PATCH] KeepAlive no longer accepts other than On|Off. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@883082 13f79535-47bb-0310-9956-ffa450edef68 --- CHANGES | 3 +++ modules/http/http_core.c | 14 +++----------- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/CHANGES b/CHANGES index da6296ad42..5bb604c20e 100644 --- a/CHANGES +++ b/CHANGES @@ -10,6 +10,9 @@ Changes with Apache 2.3.3 mod_proxy_ftp: NULL pointer dereference on error paths. [Stefan Fritsch , Joe Orton] + *) http_core: KeepAlive no longer accepts other than On|Off. + [Takashi Sato] + *) mod_dav: Remove errno from dav_error interface. Calls to dav_new_error() and dav_new_error_tag() must be adjusted to add an apr_status_t parameter. [Jeff Trawick] diff --git a/modules/http/http_core.c b/modules/http/http_core.c index ae97d314c5..8d4471eae0 100644 --- a/modules/http/http_core.c +++ b/modules/http/http_core.c @@ -63,22 +63,14 @@ static const char *set_keep_alive_timeout(cmd_parms *cmd, void *dummy, } static const char *set_keep_alive(cmd_parms *cmd, void *dummy, - const char *arg) + int arg) { const char *err = ap_check_cmd_context(cmd, NOT_IN_DIR_LOC_FILE); if (err != NULL) { return err; } - /* We've changed it to On/Off, but used to use numbers - * so we accept anything but "Off" or "0" as "On" - */ - if (!strcasecmp(arg, "off") || !strcmp(arg, "0")) { - cmd->server->keep_alive = 0; - } - else { - cmd->server->keep_alive = 1; - } + cmd->server->keep_alive = arg; return NULL; } @@ -100,7 +92,7 @@ static const command_rec http_cmds[] = { AP_INIT_TAKE1("MaxKeepAliveRequests", set_keep_alive_max, NULL, RSRC_CONF, "Maximum number of Keep-Alive requests per connection, " "or 0 for infinite"), - AP_INIT_TAKE1("KeepAlive", set_keep_alive, NULL, RSRC_CONF, + AP_INIT_FLAG("KeepAlive", set_keep_alive, NULL, RSRC_CONF, "Whether persistent connections should be On or Off"), { NULL } }; -- 2.40.0