httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ryan Bloom <...@covalent.net>
Subject Re: [PATCH] http2env optimization
Date Sat, 10 Nov 2001 17:33:07 GMT
On Friday 09 November 2001 10:17 pm, Brian Pane wrote:
> Index: server/util_script.c
> ===================================================================
> RCS file: /home/cvspublic/httpd-2.0/server/util_script.c,v
> retrieving revision 1.64
> diff -u -r1.64 util_script.c
> --- server/util_script.c        2001/09/24 21:09:06     1.64
> +++ server/util_script.c        2001/11/10 06:02:13
> @@ -95,19 +95,26 @@
>  #define MALFORMED_MESSAGE "malformed header from script. Bad header="
>  #define MALFORMED_HEADER_LENGTH_TO_SHOW 30
>  
> -static char *http2env(apr_pool_t *a, char *w)
> +static char *http2env(apr_pool_t *a, const char *w)
>  {
> -    char *res = apr_pstrcat(a, "HTTP_", w, NULL);
> +    char *res = (char *)apr_palloc(a, 6 + strlen(w));

Pleaes don't use a magic number 6.  Can we just make that strlen("HTTP_") + 1,
any compiler worth its salt will convert that at compile time.

Other than that, +1.

Ryan


______________________________________________________________
Ryan Bloom				rbb@apache.org
Covalent Technologies			rbb@covalent.net
--------------------------------------------------------------

Mime
View raw message