You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@httpd.apache.org by wr...@apache.org on 2007/09/12 12:47:03 UTC
svn commit: r574884 - /httpd/httpd/trunk/modules/ssl/ssl_engine_vars.c
Author: wrowe
Date: Wed Sep 12 03:47:02 2007
New Revision: 574884
URL: http://svn.apache.org/viewvc?rev=574884&view=rev
Log:
Resolve storage of process-lifespan version strings for OpenSSL,
while using request-lifespan copies for manipulation.
Reviewed by RPleum, ZHar'El
Modified:
httpd/httpd/trunk/modules/ssl/ssl_engine_vars.c
Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_vars.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_vars.c?rev=574884&r1=574883&r2=574884&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_engine_vars.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_engine_vars.c Wed Sep 12 03:47:02 2007
@@ -49,7 +49,7 @@
static char *ssl_var_lookup_ssl_cert_verify(apr_pool_t *p, conn_rec *c);
static char *ssl_var_lookup_ssl_cipher(apr_pool_t *p, conn_rec *c, char *var);
static void ssl_var_lookup_ssl_cipher_bits(SSL *ssl, int *usekeysize, int *algkeysize);
-static char *ssl_var_lookup_ssl_version(apr_pool_t *p, char *var);
+static char *ssl_var_lookup_ssl_version(apr_pool_t *pp, apr_pool_t *p, char *var);
static char *ssl_var_lookup_ssl_compress_meth(SSL *ssl);
static int ssl_is_https(conn_rec *c)
@@ -190,7 +190,7 @@
*/
if (result == NULL) {
if (strlen(var) > 12 && strcEQn(var, "SSL_VERSION_", 12))
- result = ssl_var_lookup_ssl_version(p, var+12);
+ result = ssl_var_lookup_ssl_version(s->process->pool, p, var+12);
else if (strcEQ(var, "SERVER_SOFTWARE"))
result = ap_get_server_banner();
else if (strcEQ(var, "API_VERSION")) {
@@ -262,7 +262,8 @@
ssl = sslconn->ssl;
if (strlen(var) > 8 && strcEQn(var, "VERSION_", 8)) {
- result = ssl_var_lookup_ssl_version(p, var+8);
+ result = ssl_var_lookup_ssl_version(c->base_server->process->pool,
+ p, var+8);
}
else if (ssl != NULL && strcEQ(var, "PROTOCOL")) {
result = (char *)SSL_get_version(ssl);
@@ -633,7 +634,7 @@
return;
}
-static char *ssl_var_lookup_ssl_version(apr_pool_t *p, char *var)
+static char *ssl_var_lookup_ssl_version(apr_pool_t *pp, apr_pool_t *p, char *var)
{
static const char interface[] = "mod_ssl/" MOD_SSL_VERSION;
static char library_interface[] = SSL_LIBRARY_TEXT;
@@ -642,7 +643,7 @@
if (!library) {
char *cp, *cp2;
- library = apr_pstrdup(p, SSL_LIBRARY_DYNTEXT);
+ library = apr_pstrdup(pp, SSL_LIBRARY_DYNTEXT);
if ((cp = strchr(library, ' ')) != NULL) {
*cp = '/';
if ((cp2 = strchr(cp, ' ')) != NULL)
Re: svn commit: r574884 - /httpd/httpd/trunk/modules/ssl/ssl_engine_vars.c
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
William A. Rowe, Jr. wrote:
> Joe Orton wrote:
>> Ewww. This passes around a process-global pool to functions which can
>> get invoked at any time during request processing, which just invites a
>> thread-safety fubar down the line. It only happens to be safe now
>> because the function is invoked at startup.
>
> We call this during each config iteration, logging (even if logs are off
> we call the silly function) the version in-use. Ergo it's never NULL once
> we've spun off threads and are off to the races.
Would you be happier with a comment at the initialization formatting call
which says "this call is required to initialize the ssl version string"?
Re: svn commit: r574884 - /httpd/httpd/trunk/modules/ssl/ssl_engine_vars.c
Posted by "William A. Rowe, Jr." <wr...@rowe-clan.net>.
Joe Orton wrote:
> On Wed, Sep 12, 2007 at 10:47:03AM -0000, William Rowe wrote:
>> Author: wrowe
>> Date: Wed Sep 12 03:47:02 2007
>> New Revision: 574884
>>
>> URL: http://svn.apache.org/viewvc?rev=574884&view=rev
>> Log:
>> Resolve storage of process-lifespan version strings for OpenSSL,
>> while using request-lifespan copies for manipulation.
>
> Ewww. This passes around a process-global pool to functions which can
> get invoked at any time during request processing, which just invites a
> thread-safety fubar down the line. It only happens to be safe now
> because the function is invoked at startup.
s/functions/function/
> Is there a reason you prefered this to the patch I posted?
Simplicity? That's really the entire reason.
In fact it is thread-safe, although if you wanted the per-request flavor
to pass NULL and explode in an inconceivable manner, that would be OK too.
We call this during each config iteration, logging (even if logs are off
we call the silly function) the version in-use. Ergo it's never NULL once
we've spun off threads and are off to the races.
Correct?
Bill
Re: svn commit: r574884 - /httpd/httpd/trunk/modules/ssl/ssl_engine_vars.c
Posted by Joe Orton <jo...@redhat.com>.
On Wed, Sep 12, 2007 at 10:47:03AM -0000, William Rowe wrote:
> Author: wrowe
> Date: Wed Sep 12 03:47:02 2007
> New Revision: 574884
>
> URL: http://svn.apache.org/viewvc?rev=574884&view=rev
> Log:
> Resolve storage of process-lifespan version strings for OpenSSL,
> while using request-lifespan copies for manipulation.
Ewww. This passes around a process-global pool to functions which can
get invoked at any time during request processing, which just invites a
thread-safety fubar down the line. It only happens to be safe now
because the function is invoked at startup.
Is there a reason you prefered this to the patch I posted?
joe