You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by RCHAPACH Rochester <rc...@us.ibm.com> on 2002/02/04 16:54:10 UTC
[PATCH] mod_mime.c
In theme with the "broken module" being allowed in ap_directory_walk()
and ap_file_walk(), find_ct() of mod_mime.c needs the following change
to allow a missing filename to pass through to the handlers. I am pretty
sure that DECLINED is the correct return, but I don't think it matters.
Index: mod_mime.c
===================================================================
RCS file: /home/cvs/httpd-2.0/modules/http/mod_mime.c
retrieving revision 1.76
--- mod_mime.c Sat Dec 8 02:02:51 2001
+++ mod_mime.c Mon Feb 4 09:30:46 2002
@@ -736,6 +736,14 @@
const char *fn, *type, *charset = NULL;
int found_metadata = 0;
+ /* To allow broken modules to proceed, we allow missing filenames to
pass.
+ * We will catch it later if it's heading for the core handler.
+ * directory_walk already posted an INFO note for module debugging.
+ */
+ if (!r->filename) {
+ return DECLINED;
+ }
+
if (r->finfo.filetype == APR_DIR) {
r->content_type = DIR_MAGIC_TYPE;
return OK;
Kent Bruinsma
bruinsma@us.ibm.com
Re: [PATCH] mod_mime.c
Posted by Jeff Trawick <tr...@attglobal.net>.
"RCHAPACH Rochester" <rc...@us.ibm.com> writes:
> In theme with the "broken module" being allowed in ap_directory_walk()
> and ap_file_walk(), find_ct() of mod_mime.c needs the following change
> to allow a missing filename to pass through to the handlers. I am pretty
> sure that DECLINED is the correct return, but I don't think it matters.
Conceptually I'm having trouble with the concept of "broken module"
here and "older modules" in the first showstopper listed in STATUS. I
don't know if we mean "module is violating the API and should be
nailed" or "module is using the API in a valid way which is different
than most modules" or something in-between.
If the module is violating the API, we shouldn't try to accomodate it
at all. Maybe we can figure out a way that type checkers wouldn't
have to validate r->filename.
If for all we know the module is operating properly, then we are
essentially forcing all type checkers to validate r->filename, and the
comment below about "broken modules" is invalid, and we need to
somehow document that a module can't depend on r->filename.
> Index: mod_mime.c
> ===================================================================
> RCS file: /home/cvs/httpd-2.0/modules/http/mod_mime.c
> retrieving revision 1.76
> --- mod_mime.c Sat Dec 8 02:02:51 2001
> +++ mod_mime.c Mon Feb 4 09:30:46 2002
> @@ -736,6 +736,14 @@
> const char *fn, *type, *charset = NULL;
> int found_metadata = 0;
>
> + /* To allow broken modules to proceed, we allow missing filenames to
> pass.
In need of a clue,
--
Jeff Trawick | trawick@attglobal.net
Born in Roswell... married an alien...