httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@lnd.com>
Subject RE: Global data is evil :)
Date Mon, 07 Aug 2000 15:39:52 GMT
> From: rbb@covalent.net [mailto:rbb@covalent.net]
> Sent: Monday, August 07, 2000 9:23 AM
> 
> On Mon, 7 Aug 2000, William A. Rowe, Jr. wrote:
> 
> > Does anyone object to this untested (but compiling) revision?
> > Assuming the answer is no, I will commit it Monday eve, with the
> > appropriate changes to http_main.c and mpm/win32/service.c
> 
> Yes, I object.  That getopt code was being used because it was from
> FreeBSD.  We were trying to avoid using a standard function name and then
> having it behave in a completely unexpected way.  By using the code from
> FreeBSD, we know the code works, and we know that it looks like other
> getopt code.  The only reason we replaced getopt was that it wasn't
> standard across all platforms.

Let me clarify, yes I would throw a testopt.c in in the apr/tests lib,
and will pound it out -before- it were committed.

And following the reasons below, if this isn't the exact FreeBSD call,
then it isn't.  This is APR, not the Posix Portibility library.  I thought
I'd followed the 'spirit' of the APR calling conventions.  Correct me if
I'm wrong on that.

> What problem are you trying to solve with this?  

The usual :)  The WinNT MPM parses out what it cares about (what
http_main doesn't).  It rebuilds the argv list.  Same with the services,
the WinNT MPM merges a seperate argv list from the Service Control
Manager, as well as an argv list from the installed parameters.

We trust each to reset the getopt code before the next code block
reparses it.  It's not a -requirement- today to be thread safe, 
I simply believe it's prudent design.

> The only problem with this code, is that it uses globabl variable, 
> which makes it non-threadsafe, but we are using this function to 
> parse command line options.  We shouldn't need to do that after 
> we have spawned threads.

Global variables, 5 of them, polluting the namespace :)  I can take
this code or leave it (regardless, I'll probably save it for myself)
but if others care for it, or this changes your perspective Ryan,
please speak up... it's off the table for now.

Bill

Mime
View raw message