httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bertrand Mansion <bmans...@mamasam.net>
Subject Re: patch for handling headers_in and headers_out as tables in mod_lua
Date Wed, 18 Mar 2009 22:30:46 GMT
On Sun, Mar 1, 2009 at 2:37 AM, Brian McCallister <brianm@skife.org> wrote:
> On Fri, Feb 27, 2009 at 2:55 AM, Bertrand Mansion <bmansion@mamasam.net> wrote:
>
>> And I find it weird that, now, to get 'document root', you have to
>> call r:document_root() instead of r.document_root as it was before.
>> That's because the dispatch is set like this:
>>    apr_hash_set(dispatch, "document_root", APR_HASH_KEY_STRING,
>>                 makefun(&req_document_root, APL_REQ_FUNTYPE_LUACFUN,
p));
>>
>> It could be just:
>>    apr_hash_set(dispatch, "document_root", APR_HASH_KEY_STRING,
>>                 makefun(&req_content_encoding_field, APL_REQ_FUNTYPE_STRING,
>>                         p));
>
> Agreed, this is much nicer syntax. Applied this change as well. Thanks!

Hi Brian, the change does not compile on my box, I suggest this instead:

static char *req_document_root(request_rec *r)
{
    const char *docroot = ap_document_root(r);
    return apr_pstrdup(r->pool, docroot ? docroot : "");
}

Thanks,

-- 
Bertrand Mansion
Mamasam

Mime
View raw message