Here's one for the mod_perl monks... Basically the problem I've run into is that returning DECLINED from a handler doesn't completely return you to the 'normal' chain of events in Apache like it is supposed to (and as the 'Apache Modules' book seems to agree). If I have a handler that looks like
package myHandler; use strict; use Apache; use Apache::Constants wq(:response); sub handler { my $r = shift; my $uri = $r->uri(); unless ($uri =~ /\.extension$/) { return DECLINED; } # rest of code
and a httpd.conf block like
<Directory "/usr/local/apache/sites/test"> SetHandler perl-script PerlHandler myHandler Options Indexes Includes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory>
I can't also have something like a PHP page in that same directory. PHP will be handled correctly in other directories, but will return the source for the page in this one. Granted I don't use PHP, but I'm trying to make this 'place nice with others'. Even stranger, if I add in a "ErrorDocument 404 /404.html" directive to that block, and access a page that doesn't exist, the connection just instantly closes.
[root@styx conf]# telnet localhost 80 Trying 127.0.0.1... Connected to localhost. Escape character is '^]'. GET /test/you_are_not_here HTTP/1.0 Connection closed by foreign host.
I can get around this by using a 'Files ~' directive in the httpd.conf to match only my extension, but it seems like declining should work.

According to Writing Apache Modules pg 68. "The handler has decided it doesn't want to handle the request. Apache will act as if the subroutine were never called and either handle the phase internally or pass the request on to another module that has expressed its interest."

What am I missing here?

/\/\averick
perl -l -e "eval pack('h*','072796e6470272f2c5f2c5166756279636b672');"


In reply to DECLINED from mod_perl doesn't work quite like I expect... by maverick

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.