httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@algroup.co.uk>
Subject Re: [PATCH] Start of command handlers patch
Date Sun, 11 Jun 2000 23:56:31 GMT
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/

Mime
View raw message