httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Colm MacCarthaigh <c...@stdlib.net>
Subject Re: [PATCH] add User-Agent to dummy connection
Date Mon, 08 Aug 2005 15:42:09 GMT
On Mon, Aug 08, 2005 at 11:29:59AM -0400, Brian Akins wrote:
> 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? 

I was worred about the output of ap_get_server_version changing over
time, but actually looking at the core, that now seems stupid (I'd
incorrectly assumed things like mod_security might touch it, like
they do the Signature). 

In fact, I'm not really sure if it's worth running at all.

AP_SERVER_BASEVERSION is probably good enough, the administrators are
going to know their component, and it gets rid of the double bracket
component.

>  It seems like a wast of cycles and memory to alloc it each time.
> 
> maybe just make it static like:
> 
> static char *srequest = NULL;

or;

const char *srequest = "GET / HTTP/1.0\r\n"
                       "User-Agent: " AP_SERVER_BASEVERSION
                       " (dummy connection)\r\n\r\n";

-- 
Colm MacCárthaigh                        Public Key: colm+pgp@stdlib.net

Mime
View raw message