httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christophe JAILLET" <christophe.jail...@wanadoo.fr>
Subject Why 'apr_pstrdup' constant strings ?
Date Tue, 28 Jun 2011 20:03:10 GMT
Hi,

in several places, we are making a apr_pstrdup on a *constant* string.
I've found at least :
    - server/protocol.c - line 538
    - server/protocol.c - line 615
    - modules/proxy/proxy_util.c - line 546
    - modules/http/http_request.c - line 200
    - modules/generators/mod_cgid.c - line 1587
    - modules/generators/mod_asis.c - line 73
    - modules/generators/mod_cgi.c - line 990
    - arch/win32/mod_isapi.c - line 897

What is the use of such a copy ?

Couldn't we replace, for example :
        r->method = apr_pstrdup(r->pool, "GET");
by
        r->method = "GET";

CJ




Mime
View raw message