> -----Original Message-----
> From: Geoffrey Young [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, June 06, 2000 2:03 PM
> To: 'Jim Sproull'; [EMAIL PROTECTED]
> Subject: RE: NEWBIE: appending to page content
>
>
> > >
> > sub handler {
> > my $r = shift;
> > $log = $r->server->log;
> >
> > log_info("Opening ". $r->filename . " w/ type of " .
> > $r->content_type);
> >
> > $rqh = Apache::File->new($r->filename)
> > || return SERVER_ERROR;
> >
> > $r->send_http_header();
> > $r->send_fd($rqh);
> >
> > if ($r->content_type eq "text/html") { # it's HTML
> > log_info("Appending extra data ");
> > $r->print("testing");
> > }
> >
> > return OK;
>
> try returning DECLINED if $r->content_type is 'httpd/unix-directory' or
> matches directory or something similar. put this at the top of
> your handler
> so that the decline is topmost and you avoid unnecessary
> processing... this
> will let apache's normal directory indexing take over when appropriate...
>
> HTH
>
> --Geoff
>
Hi again Geoff. Thanks for the quick answer. I actually tried adding
return DECLINED if
$r->content_type ne "text/html";
at the top, which seems to stop the connection dead in its tracks (when
content_type ne 'text/html') and I get this:
Making HTTP connection to jim.sitepak.net.
Sending HTTP request.
HTTP request sent; waiting for response.
Alert!: Unexpected network read error; connection aborted.
I didn't think that looked right, but I wasn't exactly sure what returning
DECLINED did (in terms of the request process). Any ideas?
Jim
[EMAIL PROTECTED]
> > }
> >
> > This works fine for specified html pages. However, when a
> > DirectoryIndex
> > page is called indirectly (http://www.foobar.com/ for
> > instance), an item of
> > type httpd/unix-directory gets printed. So, I guess I'm
> > asking 'in what
> > stage does the DirectoryIndex get called, and why is it being
> > ignored in
> > this case?'
> >
> > Jim
> > [EMAIL PROTECTED]
> >
>