httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rainer Jung <rainer.j...@kippdata.de>
Subject Calling usage() from the rewrite args hook?
Date Wed, 06 May 2009 19:33:05 GMT
While working on additional windows commandline options I noticed, that
there is no consistent checking for validity of the "-k" arguments.

Those arguments are handled by the rewrite args hook, and some MPMs seem
to care somehow about invalid or duplicate "-k" arguments (e.g. Unix
outputs a somewhat wrong error message about -k being unknown), windows
seems to start the service when an unknown command is given.

I would like to output a better error message for unknown or duplicate
commands (easy) and then call usage(). At the moment usage() is static
in main.c and there is not a single header file directly in the server/
directory.

So I would like to add a private header file in the server directory, at
the moment only containing usage() and switch usage() from static to
AP_DECLARE. Would that be right? I guess we have no reason to include it
in the public include files contained in includes/.

Another possibility would be to let the rewrite args hook return a
value, stop processing as soon as one module doesn't return OK and call
the usage whenever rewrite args for a module do not return OK. I think
that's a bit fragile, because in the long run, more return values might
show up and cases, where usage() is not the right way to react, so
making usage() available in the mpm-specific module argument handling
seems to be the better way.

Of course the usage message at the moment doesn't really reflect the MPM
architecture. The commandline specialities are reflected by ifdefs in
the usage, but that's another topic. For the above needed hardening of
parsing the -k flags, the usage message as it exists today is enough.

Comments?

Regards,

Rainer


Mime
View raw message