Return-Path: Delivered-To: apmail-new-httpd-archive@apache.org Received: (qmail 56104 invoked by uid 500); 11 Jun 2000 23:53:58 -0000 Mailing-List: contact new-httpd-help@apache.org; run by ezmlm Precedence: bulk X-No-Archive: yes Reply-To: new-httpd@apache.org list-help: list-unsubscribe: list-post: Delivered-To: mailing list new-httpd@apache.org Received: (qmail 56093 invoked from network); 11 Jun 2000 23:53:57 -0000 Message-ID: <3944272F.6B807CB3@algroup.co.uk> Date: Mon, 12 Jun 2000 00:56:31 +0100 From: Ben Laurie Organization: A.L. Group plc X-Mailer: Mozilla 4.7 [en] (WinNT; I) MIME-Version: 1.0 To: new-httpd@apache.org Subject: Re: [PATCH] Start of command handlers patch References: <3943FD19.5BC6AB6D@algroup.co.uk> <20000611141344.X19484@lyra.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N Greg Stein wrote: > > On Sun, Jun 11, 2000 at 09:56:57PM +0100, Ben Laurie wrote: > > Just to make sure everyone knows what I had in mind, here's the start of > > the patch. BTW, if we're all agreed this is worth doing, I'd really like > > to commit it part-done and share the load of converting every single > > command handler! > > I'm fine with a broken repository for a while :-) > > >... > > --- include/http_config.h 2000/06/06 01:20:01 1.30 > > +++ include/http_config.h 2000/06/11 20:48:03 > > @@ -96,9 +96,11 @@ > > TAKE13 /* one or three arguments */ > > }; > > > > +typedef struct cmd_parms_struct cmd_parms; > > + > > typedef struct command_struct { > > const char *name; /* Name of this command */ > > - const char *(*func) (); /* Function invoked */ > > + const char *(*func_) (cmd_parms *); /* Function invoked */ > > The trailing underscore is ugly ... what's it in there for? A development aid - it'll be gone before I commit. > >... > > --- main/http_config.c 2000/06/06 01:20:02 1.60 > > +++ main/http_config.c 2000/06/11 20:48:09 > > @@ -645,22 +645,23 @@ > > > > parms->info = cmd->cmd_data; > > parms->cmd = cmd; > > + parms->mconfig = mconfig; > > + parms->args = NULL; > > > > Why is parms->args set to NULL, but none of the others are? Can't we just > assume that parms has been zeroed by default and skip this? I forgot to do the others - I don't think we can assume that, no - consider a TAKE12 used twice. > > >... > > --- main/http_core.c 2000/06/06 21:45:11 1.70 > > +++ main/http_core.c 2000/06/11 20:48:10 > > @@ -1374,10 +1374,10 @@ > > "> directive missing closing '>'", NULL); > > } > > > > -static const char *dirsection(cmd_parms *cmd, void *dummy, const char *arg) > > +static const char *dirsection(cmd_parms *cmd) > > { > > const char *errmsg; > > - char *endp = strrchr(arg, '>'); > > + char *endp = strrchr(cmd->args, '>'); > > int old_overrides = cmd->override; > > char *old_path = cmd->path; > > core_dir_config *conf; > > @@ -1397,14 +1397,14 @@ > > > > *endp = '\0'; > > > > - cmd->path = ap_getword_conf(cmd->pool, &arg); > > + cmd->path = ap_getword_conf(cmd->pool, &cmd->args); > > Hmm. Unsure on this one... I'm a bit more comfortable thinking that > cmd->args should not have its value altered. Well, strictly, perhaps, but it is _only_ used by the command handler. It did give me pause, too. Cheers, Ben. -- http://www.apache-ssl.org/ben.html Coming to ApacheCon Europe 2000? http://apachecon.com/