httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Akins <bak...@web.turner.com>
Subject Re: [PATCH] add User-Agent to dummy connection
Date Mon, 08 Aug 2005 15:29:59 GMT
Colm MacCarthaigh wrote:
> On Mon, Aug 08, 2005 at 03:24:44PM +0100, Colm MacCarthaigh wrote:

> +    srequest = apr_pstrcat(p, "GET / HTTP/1.0\r\nUser-Agent: ", 
> +                           ap_get_server_version(), 
> +                           " (internal dummy connection)\r\n\r\n", NULL);

Shouldn't this string only be created once for the lifetime of the 
server?  It seems like a wast of cycles and memory to alloc it each time.

maybe just make it static like:

static char *srequest = NULL;

if(!srequest) {
	srequest = /*do strcat stuff*/
}

or something along the same lines.


-- 
Brian Akins
Lead Systems Engineer
CNN Internet Technologies

Mime
View raw message