You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dean Gaudet <dg...@arctic.org> on 2000/01/21 22:39:29 UTC

Re: cvs commit: apache-2.0/src/include http_core.h


On 21 Jan 2000 stoddard@hyperreal.org wrote:

>   +#ifdef WIN32
>   +    /* Where to find interpreter to run scripts */
>   +    interpreter_source_e script_interpreter_source;
>   +#endif    
>   +    

yuck.

this is an example of a place where something like EAPI's hooks would be
nice.

Dean


Re: cvs commit: apache-2.0/src/include http_core.h

Posted by Ben Laurie <be...@algroup.co.uk>.
Dean Gaudet wrote:
> 
> On Sun, 23 Jan 2000, Ben Laurie wrote:
> 
> > Ah, gotcha. It still niggles at me that it always seems to come down to
> > void *s, though.
> 
> hrm... which aspect of void * is troublesome?
> 
> the typelessness bothers me a bit.

That's the one!

> the array of void *'s for module per_dir and per_server configs bothers me
> in that it wastes memory.  an array of atoms wouldn't bother me so much --
> because an atom is allocated for each module/group of modules that wish to
> attach data to the structure.  (whereas right now we allocate a void * for
> each module regardless of whether they use it or not)

Yep ... that's one of the things the new hooks improve (though obviously
only for hooking functions and not data structures).

> but none of those bother me as much as #ifdefs :)
> 
> i'm not an OO person.  how would you do this sort of dynamic extension in
> an OO language?

Inheritence and factories? It depends on what you are trying to achieve,
of course, but that's certainly one common scheme. I have to say,
though, that although OO improves the situation, I've yet to see a truly
satisfactory way to handle this stuff!

Cheers,

Ben.

--
SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm

http://www.apache-ssl.org/ben.html

Y19100 no-prize winner!
http://www.ntk.net/index.cgi?back=2000/now0121.txt

Re: cvs commit: apache-2.0/src/include http_core.h

Posted by Dean Gaudet <dg...@arctic.org>.

On Sun, 23 Jan 2000, Ben Laurie wrote:

> Ah, gotcha. It still niggles at me that it always seems to come down to
> void *s, though.

hrm... which aspect of void * is troublesome?

the typelessness bothers me a bit.

the array of void *'s for module per_dir and per_server configs bothers me
in that it wastes memory.  an array of atoms wouldn't bother me so much --
because an atom is allocated for each module/group of modules that wish to
attach data to the structure.  (whereas right now we allocate a void * for
each module regardless of whether they use it or not)

but none of those bother me as much as #ifdefs :)

i'm not an OO person.  how would you do this sort of dynamic extension in
an OO language?

Dean





Re: cvs commit: apache-2.0/src/include http_core.h

Posted by Ben Laurie <be...@algroup.co.uk>.
Dean Gaudet wrote:
> 
> On Sat, 22 Jan 2000, Ben Laurie wrote:
> 
> > Dean Gaudet wrote:
> > >
> > > On 21 Jan 2000 stoddard@hyperreal.org wrote:
> > >
> > > >   +#ifdef WIN32
> > > >   +    /* Where to find interpreter to run scripts */
> > > >   +    interpreter_source_e script_interpreter_source;
> > > >   +#endif
> > > >   +
> > >
> > > yuck.
> > >
> > > this is an example of a place where something like EAPI's hooks would be
> > > nice.
> >
> > Would you care to elaborate?
> 
> it's a module-specific addition to a core structure (in this case the
> module is an MPM).  ISTR EAPI has tables or something in many structures
> for adding arbitrary void *s.  we wanted that tweaked to use atoms instead
> of strings... but at any rate, it would solve this problem without the
> need of a #ifdef.

Ah, gotcha. It still niggles at me that it always seems to come down to
void *s, though.

Cheers,

Ben.

--
SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm

http://www.apache-ssl.org/ben.html

Y19100 no-prize winner!
http://www.ntk.net/index.cgi?back=2000/now0121.txt

Re: cvs commit: apache-2.0/src/include http_core.h

Posted by Dean Gaudet <dg...@arctic.org>.

On Sun, 23 Jan 2000, Dean Gaudet wrote:

> On Sat, 22 Jan 2000, Ben Laurie wrote:
> 
> > Dean Gaudet wrote:
> > > 
> > > On 21 Jan 2000 stoddard@hyperreal.org wrote:
> > > 
> > > >   +#ifdef WIN32
> > > >   +    /* Where to find interpreter to run scripts */
> > > >   +    interpreter_source_e script_interpreter_source;
> > > >   +#endif
> > > >   +
> > > 
> > > yuck.
> > > 
> > > this is an example of a place where something like EAPI's hooks would be
> > > nice.
> > 
> > Would you care to elaborate?
> 
> it's a module-specific addition to a core structure (in this case the
> module is an MPM).  ISTR EAPI has tables or something in many structures
> for adding arbitrary void *s.  we wanted that tweaked to use atoms instead
> of strings... but at any rate, it would solve this problem without the
> need of a #ifdef.

eh, wait.

the core structure is core_dir_config.

this could be implemented using a dir_config in the win32 mpm... which
would be preferable to adding the #ifdefs to http_core.h.

Dean


Re: cvs commit: apache-2.0/src/include http_core.h

Posted by Dean Gaudet <dg...@arctic.org>.

On Sat, 22 Jan 2000, Ben Laurie wrote:

> Dean Gaudet wrote:
> > 
> > On 21 Jan 2000 stoddard@hyperreal.org wrote:
> > 
> > >   +#ifdef WIN32
> > >   +    /* Where to find interpreter to run scripts */
> > >   +    interpreter_source_e script_interpreter_source;
> > >   +#endif
> > >   +
> > 
> > yuck.
> > 
> > this is an example of a place where something like EAPI's hooks would be
> > nice.
> 
> Would you care to elaborate?

it's a module-specific addition to a core structure (in this case the
module is an MPM).  ISTR EAPI has tables or something in many structures
for adding arbitrary void *s.  we wanted that tweaked to use atoms instead
of strings... but at any rate, it would solve this problem without the
need of a #ifdef.

Dean


Re: cvs commit: apache-2.0/src/include http_core.h

Posted by Ben Laurie <be...@algroup.co.uk>.
Dean Gaudet wrote:
> 
> On 21 Jan 2000 stoddard@hyperreal.org wrote:
> 
> >   +#ifdef WIN32
> >   +    /* Where to find interpreter to run scripts */
> >   +    interpreter_source_e script_interpreter_source;
> >   +#endif
> >   +
> 
> yuck.
> 
> this is an example of a place where something like EAPI's hooks would be
> nice.

Would you care to elaborate?

Cheers,

Ben.

--
SECURE HOSTING AT THE BUNKER! http://www.thebunker.net/hosting.htm

http://www.apache-ssl.org/ben.html

"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
     - Indira Gandhi