Loading ...
Sorry, an error occurred while loading the content.

[mp2] retrieving the calling handler

Expand Messages
  • Dorian Taylor
    how would i go about retrieving (mod_perl or otherwise) the name of the immediate calling handler of the current handler being executed? i m trying to do loop
    Message 1 of 2 , Jan 31, 2005
    • 0 Attachment
      how would i go about retrieving (mod_perl or otherwise) the name
      of the immediate calling handler of the current handler being
      executed?

      i'm trying to do loop checking in which a given handler may need
      to be executed as a result of multiple subrequests, but never back
      to back.

      e.g.:

      # httpd.conf ...

      # mod_transform uses an output filter to trap the content of a response
      # it lives at http://www.outoforder.cc/projects/apache/mod_transform/docs/
      LoadModule transform_module modules/mod_transform.so

      # Apache::MyStuff cleans up uri->filename stuff
      <Location /foo>
      PerlTypeHandler Apache::MyStuff
      AddOutputFilter XSLT .xml
      </Location>

      so, the scenario here is that mod_transform needs to subrequest its
      external entities. these external entities need to be able to run
      once through the type handler, but only once, as the type handler
      will loop indefinitely. the timeline goes as such:

      * request comes in from a browser, or possibly a subrequest.

      * Apache::MyStuff examines uri.

      * Apache::MyStuff may run a lookup_uri here or there (these do not trigger
      Apache::MyStuff's handler because some sort of state is set).

      * http_core (or whatever) serves up a resource, probably xml.

      * if it's xml, mod_transform picks up and starts trying to dereference
      the external entities using its filter to trap the output.

      * as entities are being dereferenced, Apache::MyStuff is called once again
      as if the subrequest lookup generated by the entity dereference
      was an external request.

      so anyway, what i'm trying to figure out is how to set a state in
      a handler temporarily, so that subrequests spawned from it and it
      only do not cause it to recurse, but if it's invoked as a subrequest
      or internal redirect from another handler, it does its job.

      if anyone can suggest anything, i'd be greatly appreciative.

      thanks

      .d
    • Philippe M. Chiasson
      ... There was someone with a similar problem just a while ago: http://gossamer-threads.com/lists/modperl/modperl/77721 I believe it is relevant to your
      Message 2 of 2 , Feb 1, 2005
      • 0 Attachment
        Dorian Taylor wrote:
        > how would i go about retrieving (mod_perl or otherwise) the name
        > of the immediate calling handler of the current handler being
        > executed?
        >
        > i'm trying to do loop checking in which a given handler may need
        > to be executed as a result of multiple subrequests, but never back
        > to back.

        There was someone with a similar problem just a while ago:

        http://gossamer-threads.com/lists/modperl/modperl/77721

        I believe it is relevant to your question.

        --------------------------------------------------------------------------------
        Philippe M. Chiasson m/gozer\@(apache|cpan|ectoplasm)\.org/ GPG KeyID : 88C3A5A5
        http://gozer.ectoplasm.org/ F9BF E0C2 480E 7680 1AE5 3631 CB32 A107 88C3A5A5
      Your message has been successfully submitted and would be delivered to recipients shortly.