httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ruediger Pluem <rpl...@apache.org>
Subject Re: AW: SSL_VERSION_LIBRARY
Date Mon, 10 Sep 2007 19:47:24 GMT


On 09/10/2007 08:40 AM, Plüm wrote:
> 
>> -----Ursprüngliche Nachricht-----
>> Von: William A. Rowe, Jr.
>> Gesendet: Montag, 10. September 2007 07:50
>> An: dev@httpd.apache.org
>> Betreff: Re: SSL_VERSION_LIBRARY
>>
>>
>> Zvi Har'El wrote:
>>>> This looks similar to PR 43334 
>> (https://issues.apache.org/bugzilla/show_bug.cgi?id=43334).
>>>> Could you please test my diagnostic patch from there?
>> Yup - that patch would solve it since we don't reinit static 
>> char*library
>> to null on every unload/reload cycle.
>>
>> The fix is either to do it always (as this patch does) - or since
>> it might outlive p, delve down to parent pool (process scope) and
>> allocate from there.
> 
> That was the goal of my diagnostic patch: Finding out if we have a pool
> issue. Looks like we have. I guess the right fix is as you say 
> to use the parent pool (process scope).

Not 100% sure regarding the correct pool, but would that be the correct fix

Index: modules/ssl/ssl_engine_vars.c
===================================================================
--- modules/ssl/ssl_engine_vars.c       (Revision 573732)
+++ modules/ssl/ssl_engine_vars.c       (Arbeitskopie)
@@ -642,7 +642,13 @@

     if (!library) {
         char *cp, *cp2;
-        library = apr_pstrdup(p, SSL_LIBRARY_DYNTEXT);
+        apr_pool_t *lp1, *lp2;
+
+        lp1 = p;
+        while ((lp2 = apr_pool_parent_get(lp1)) != NULL) {
+            lp1 = lp2;
+        }
+        library = apr_pstrdup(lp1, SSL_LIBRARY_DYNTEXT);
         if ((cp = strchr(library, ' ')) != NULL) {
             *cp = '/';
             if ((cp2 = strchr(cp, ' ')) != NULL)


?

or is the following already sufficient?

Index: modules/ssl/ssl_engine_vars.c
===================================================================
--- modules/ssl/ssl_engine_vars.c       (Revision 573732)
+++ modules/ssl/ssl_engine_vars.c       (Arbeitskopie)
@@ -642,7 +642,13 @@

     if (!library) {
         char *cp, *cp2;
-        library = apr_pstrdup(p, SSL_LIBRARY_DYNTEXT);
+        apr_pool_t *lp;
+
+        lp = apr_pool_parent_get(p);
+        if (!lp) {
+            lp = p;
+        }
+        library = apr_pstrdup(lp, SSL_LIBRARY_DYNTEXT);
         if ((cp = strchr(library, ' ')) != NULL) {
             *cp = '/';
             if ((cp2 = strchr(cp, ' ')) != NULL)



Regards

Rüdiger

Mime
View raw message