httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Yann Ylavic <ylavic....@gmail.com>
Subject Re: svn commit: r1533087 - in /httpd/httpd/trunk/modules/proxy: mod_proxy.h mod_proxy_balancer.c proxy_util.c
Date Thu, 17 Oct 2013 16:31:04 GMT
On Thu, Oct 17, 2013 at 6:25 PM, Yann Ylavic <ylavic.dev@gmail.com> wrote:

> On Thu, Oct 17, 2013 at 6:21 PM, Jim Jagielski <jim@jagunet.com> wrote:
>
>> This is uglier than creating a subpool... :)
>>
>
> Possibly ;) but with the pool being destroyed then...
>

Something like :

PROXY_DECLARE(char *) ap_proxy_worker_name(apr_pool_t **p,
                                           proxy_worker *worker)
{
    int rv;
    apr_uri_t uri;
    if (!(*worker->s->uds_path)) {
        return worker->s->name;
    }
    if (!*p) {
        /* ugly */
        apr_pool_create(p, ap_server_conf->process->pool);
        if (!*p) {
            /* something is better than nothing :) */
            return worker->s->name;
        }
    }
    return apr_pstrcat(*p, "unix:", worker->s->uds_path, "|",
worker->s->name, NULL);
}

so
that 
the caller caller can :
apr_poo_t *p = NULL;
char *s = ap_proxy_worker_name(&p, worker);
// play with s
if (p) {
    apr_pool_destroy(p);
}


>
> Regards.
>
>

Mime
View raw message