From e92019fdcb2f8a05ffa88cd742f576645e9183bf Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 12 Dec 2008 15:18:21 +0000 Subject: [PATCH] * modules/ssl/ssl_engine_config.c (ssl_cmd_SSLSessionCache): Allow using socache provider config defaults by omitting the arguments, so e.g. "SSLSessionCache shmcb" or even "SSLSessionCache default" should now DTRT. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@726034 13f79535-47bb-0310-9956-ffa450edef68 --- modules/ssl/ssl_engine_config.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/modules/ssl/ssl_engine_config.c b/modules/ssl/ssl_engine_config.c index e14ab78350..e062de8cd5 100644 --- a/modules/ssl/ssl_engine_config.c +++ b/modules/ssl/ssl_engine_config.c @@ -949,7 +949,7 @@ const char *ssl_cmd_SSLSessionCache(cmd_parms *cmd, const char *arg) { SSLModConfigRec *mc = myModConfig(cmd->server); - const char *err, *sep; + const char *err, *sep, *name; long enabled_flags; if ((err = ap_check_cmd_context(cmd, GLOBAL_ONLY))) { @@ -974,8 +974,16 @@ const char *ssl_cmd_SSLSessionCache(cmd_parms *cmd, * doing it by default if "none" is used. */ mc->sesscache_mode = enabled_flags; } - else if ((sep = ap_strchr_c(arg, ':')) != NULL) { - char *name = apr_pstrmemdup(cmd->pool, arg, sep - arg); + else { + /* Argument is of form 'name:args' or just 'name'. */ + sep = ap_strchr_c(arg, ':'); + if (sep) { + name = apr_pstrmemdup(cmd->pool, arg, sep - arg); + sep++; + } + else { + name = arg; + } /* Find the provider of given name. */ mc->sesscache = ap_lookup_provider(AP_SOCACHE_PROVIDER_GROUP, @@ -984,7 +992,7 @@ const char *ssl_cmd_SSLSessionCache(cmd_parms *cmd, if (mc->sesscache) { /* Cache found; create it, passing anything beyond the colon. */ mc->sesscache_mode = enabled_flags; - err = mc->sesscache->create(&mc->sesscache_context, sep + 1, + err = mc->sesscache->create(&mc->sesscache_context, sep, cmd->temp_pool, cmd->pool); } else { @@ -1002,10 +1010,6 @@ const char *ssl_cmd_SSLSessionCache(cmd_parms *cmd, "(known names: %s)", name, all_names); } } - else { - err = apr_psprintf(cmd->pool, "'%s' session cache not supported or missing argument", - arg); - } if (err) { return apr_psprintf(cmd->pool, "SSLSessionCache: %s", err);