httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dean Gaudet <dgau...@arctic.org>
Subject Re: SERVER_VERSION with OS
Date Mon, 20 Apr 1998 20:52:44 GMT


On Mon, 20 Apr 1998, Rodent of Unusual Size wrote:

> Dean Gaudet wrote:
> > 
> > I don't think you need a separate pool for this... why not take a
> > cmd_parms * argument?  read on.
> 
> Well, for one thing, there might not be a cmd_parms structure
> instantiated.  It sounds like you're assuming this will only
> be called in the context of a command handler - which I don't
> think is necessarily a safe assumption.  Or am I misunderstanding?

Maybe, maybe not.  It points to a deficiency in the config API though in
my opinion -- the temp pool isn't available outside command handlers.  At
any rate, if you look at mod_php (and probably mod_perl too, I haven't
looked) you'll see that since there is no "your module has been loaded,
you're about the be configured" phase in the API they have to check on
each command, dir/server create/merge call to see if they've been called
before.  And if not they initialize various globals.

So yeah, maybe the temp pool isn't always available... consider this a
request for it to be always available, because it leads to nice solutions
like the one I just posted. 

> API_EXPORT(void) ap_reset_server_version()
> {
>     server_version = SERVER_VERSION;
>     if (idpool != NULL) {
> 	ap_destroy_pool (idpool);
>     }
> }

I'll be more explicit:  -1 on your patch because it creates an unneeded
pool; a pool which consumes at least 8k of memory for one ~30 character
string.  (You also don't have to declare a reset function like this, you
can use a cleanup.) 

BTW Jim, I'm not adverse to doing extra work of copying strings around at
config time... it's only request time work that really concerns me. 

Dean



Mime
View raw message