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

Re: [mp1] [bug report] Re: Apache::Request vs Apache->request

Expand Messages
  • Stas Bekman
    [please keep on the list, thanks] ... t/conf/httpd.conf is automatically generated. It adds stuff from your global httpd.conf. anything that you want to
    Message 1 of 20 , Jan 29, 2004
    View Source
    • 0 Attachment
      [please keep on the list, thanks]

      Clayton Cottingham wrote:
      > hey stas!

      > > how can i set them into the httpd.conf?
      >
      > They are inherited from your global httpd.conf
      >
      >
      > this is what i need in i think!
      >
      > LoadModule status_module modules/mod_status.so
      > LoadModule info_module modules/mod_info.so
      > AddModule mod_info.c
      > AddModule mod_status.c
      >
      >
      > i tried doing this by adding to the main server commonhttpd.conf and the
      > http-perl.conf
      >
      > and the one in the test suite t/conf/httpd.conf t/conf/extra.conf.in
      >
      > and it doesnt seem to hold it in fact it erases it if i do a t/TEST
      > -clean

      t/conf/httpd.conf is automatically generated. It adds stuff from your global
      httpd.conf. anything that you want to customise should be added to
      t/conf/extra.conf.in

      > how can i add it in and have it keep it?
      >
      > else again it reports this:
      >
      > waiting 60 seconds for server to start: .Syntax error on line 80 of
      > /home/drfrog/bug-reporting-skeleton-mp1/t/conf/httpd.conf:
      > Invalid command 'SetHandler', perhaps mis-spelled or defined by a module
      > not included in the server configuration

      Looks like it doesn't have the LoadModule directive for the module containing
      this directive. Does your server installed globally work alright? You didn't
      by chance rebuilt your server with sharedlibs, but kept the old httpd.conf
      originated from the statically build server?

      If for some reason it finds the wrong httpd.conf go inherit from. You can tell
      it which httpd.conf to inherit from:

      t/TEST -httpd_conf /path/to/httpd.conf

      t/TEST --help gives you the options

      t/TEST -trace=debug does the low level debugging, so you can see what it does
      and which files it picks.



      __________________________________________________________________
      Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
      http://stason.org/ mod_perl Guide ---> http://perl.apache.org
      mailto:stas@... http://use.perl.org http://apacheweek.com
      http://modperlbook.org http://apache.org http://ticketmaster.com

      --
      Reporting bugs: http://perl.apache.org/bugs/
      Mail list info: http://perl.apache.org/maillist/modperl.html
      List etiquette: http://perl.apache.org/maillist/email-etiquette.html
    • Stas Bekman
      ... good. ... I think, yes. check that your shift in the new() call is really getting $r and not undef (e.g. not shift() ed before).
      Message 2 of 20 , Jan 29, 2004
      View Source
      • 0 Attachment
        Clayton Cottingham wrote:
        > ok thanks for the patience!
        >
        > i managed to
        > a) get the base bug report template to go under freebsd and

        good.

        > b) had my modules fail and generate error log
        >
        > which is telling me that this isnt correct:
        >
        > my $apr = Apache::Request->new(
        > shift,
        > POST_MAX => 10 * 1024 * 1024, # in bytes, so 10M
        > DISABLE_UPLOADS => 0
        > );
        >
        > my %args = $apr->args;
        >
        > with this :
        >
        > Odd number of elements in hash assignment at
        > /usr/home/clayton/bug-reporting-skeleton-mp1/t/PP/OtherThing.pm line 18.
        >
        >
        > from what ive read/been told this should be an issue correct?
        >
        > Apache::Request should be able to pass this right?

        I think, yes. check that your shift in the new() call is really getting $r and
        not undef (e.g. not shift()'ed before).

        __________________________________________________________________
        Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
        http://stason.org/ mod_perl Guide ---> http://perl.apache.org
        mailto:stas@... http://use.perl.org http://apacheweek.com
        http://modperlbook.org http://apache.org http://ticketmaster.com

        --
        Reporting bugs: http://perl.apache.org/bugs/
        Mail list info: http://perl.apache.org/maillist/modperl.html
        List etiquette: http://perl.apache.org/maillist/email-etiquette.html
      • Clayton Cottingham
        yah its calling it properly: my $apr = Apache::Request- new( shift, POST_MAX = 10 * 1024 * 1024, # in bytes, so 10M DISABLE_UPLOADS = 0 ); how
        Message 3 of 20 , Jan 29, 2004
        View Source
        • 0 Attachment
          yah its calling it properly:

          my $apr = Apache::Request->new(
          shift,
          POST_MAX => 10 * 1024 * 1024, # in bytes, so 10M
          DISABLE_UPLOADS => 0
          );



          how would one make a test to make sure the file is uploading properly?
          and what about multipart form?

          ##how to post the file???!!!
          {
          my $response = GET '/otherthing?funk=rock&file1=README';
          chomp(my $content = $response->content);
          ok t_cmp(qr{<html><body>},
          $content,
          'OtherThing.pm');
          }


          works for find ing out there is a page loading

          using t_is_equal() should be able to compare the $apr objects , but im
          unsure how to pull it into the tests!





          again i can get this all to work if i *dont* pass a file
          as soon as i start that things start wonking out

          either the parameters pass *OR* the file is downloads, but i cant get
          both to happen


          On Thu, 2004-01-29 at 16:38, Stas Bekman wrote:
          > Clayton Cottingham wrote:
          > > ok thanks for the patience!
          > >
          > > i managed to
          > > a) get the base bug report template to go under freebsd and
          >
          > good.
          >
          > > b) had my modules fail and generate error log
          > >
          > > which is telling me that this isnt correct:
          > >
          > > my $apr = Apache::Request->new(
          > > shift,
          > > POST_MAX => 10 * 1024 * 1024, # in bytes, so 10M
          > > DISABLE_UPLOADS => 0
          > > );
          > >
          > > my %args = $apr->args;
          > >
          > > with this :
          > >
          > > Odd number of elements in hash assignment at
          > > /usr/home/clayton/bug-reporting-skeleton-mp1/t/PP/OtherThing.pm line 18.
          > >
          > >
          > > from what ive read/been told this should be an issue correct?
          > >
          > > Apache::Request should be able to pass this right?
          >
          > I think, yes. check that your shift in the new() call is really getting $r and
          > not undef (e.g. not shift()'ed before).
          >
          > __________________________________________________________________
          > Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
          > http://stason.org/ mod_perl Guide ---> http://perl.apache.org
          > mailto:stas@... http://use.perl.org http://apacheweek.com
          > http://modperlbook.org http://apache.org http://ticketmaster.com
          --
          Clayton Cottingham - WinterMarket Networks
          Virtual Reality Programming, Design & Evangelist
          Phone:(604) 875-1213
          Cell: (604) 506-7230
          Vancouver, B.C. Canada
          wintermarket@...
          http://www.wintermarket.net
          IM's icq:154964789 hotmail:drfrog666@...
          yahoo:drfrog666@...


          --
          Reporting bugs: http://perl.apache.org/bugs/
          Mail list info: http://perl.apache.org/maillist/modperl.html
          List etiquette: http://perl.apache.org/maillist/email-etiquette.html
        • Stas Bekman
          ... Clayton, sorry, but I did tell you where to look for examples: http://marc.theaimsgroup.com/?l=apache-modperl&m=107541472424933&w=2 Please scroll to the
          Message 4 of 20 , Jan 29, 2004
          View Source
          • 0 Attachment
            Clayton Cottingham wrote:
            > yah its calling it properly:
            >
            > my $apr = Apache::Request->new(
            > shift,
            > POST_MAX => 10 * 1024 * 1024, # in bytes, so 10M
            > DISABLE_UPLOADS => 0
            > );
            >
            > how would one make a test to make sure the file is uploading properly?
            > and what about multipart form?

            Clayton, sorry, but I did tell you where to look for examples:
            http://marc.theaimsgroup.com/?l=apache-modperl&m=107541472424933&w=2
            Please scroll to the end of this email. Have you missed that part of my reply
            by mistake? It does *exactly* what you need.

            __________________________________________________________________
            Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
            http://stason.org/ mod_perl Guide ---> http://perl.apache.org
            mailto:stas@... http://use.perl.org http://apacheweek.com
            http://modperlbook.org http://apache.org http://ticketmaster.com

            --
            Reporting bugs: http://perl.apache.org/bugs/
            Mail list info: http://perl.apache.org/maillist/modperl.html
            List etiquette: http://perl.apache.org/maillist/email-etiquette.html
          • Clayton Cottingham
            Stas: sorry i did miss that, yesterday was too too hectic ill try this now ... -- Clayton Cottingham - WinterMarket Networks Virtual Reality Programming,
            Message 5 of 20 , Jan 30, 2004
            View Source
            • 0 Attachment
              Stas:

              sorry i did miss that, yesterday was too too hectic

              ill try this now


              On Thu, 2004-01-29 at 20:03, Stas Bekman wrote:
              > Clayton Cottingham wrote:
              > > yah its calling it properly:
              > >
              > > my $apr = Apache::Request->new(
              > > shift,
              > > POST_MAX => 10 * 1024 * 1024, # in bytes, so 10M
              > > DISABLE_UPLOADS => 0
              > > );
              > >
              > > how would one make a test to make sure the file is uploading properly?
              > > and what about multipart form?
              >
              > Clayton, sorry, but I did tell you where to look for examples:
              > http://marc.theaimsgroup.com/?l=apache-modperl&m=107541472424933&w=2
              > Please scroll to the end of this email. Have you missed that part of my reply
              > by mistake? It does *exactly* what you need.
              >
              > __________________________________________________________________
              > Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
              > http://stason.org/ mod_perl Guide ---> http://perl.apache.org
              > mailto:stas@... http://use.perl.org http://apacheweek.com
              > http://modperlbook.org http://apache.org http://ticketmaster.com
              --
              Clayton Cottingham - WinterMarket Networks
              Virtual Reality Programming, Design & Evangelist
              Phone:(604) 875-1213
              Cell: (604) 506-7230
              Vancouver, B.C. Canada
              wintermarket@...
              http://www.wintermarket.net
              IM's icq:154964789 hotmail:drfrog666@...
              yahoo:drfrog666@...


              --
              Reporting bugs: http://perl.apache.org/bugs/
              Mail list info: http://perl.apache.org/maillist/modperl.html
              List etiquette: http://perl.apache.org/maillist/email-etiquette.html
            • dreamwvr@dreamwvr.com
              Hi All, Since lookup_uri() is only to be used when the actual URI physically exists. Having said that how does not tell it to pretend that a randomly generated
              Message 6 of 20 , Feb 2, 2004
              View Source
              • 0 Attachment
                Hi All,
                Since lookup_uri() is only to be used when the actual
                URI physically exists. Having said that how does not tell
                it to pretend that a randomly generated virtual file exists?
                Is that what lookup_filename() is for? I am wanting to do a
                internal_redirect() to a virtual file whose name is always
                changing. This way the Location is never the same twice.
                Any suggestions appreciated.

                TIA
                Best Regards,
                dreamwvr@...

                --
                /* Security is a work in progress - dreamwvr */
                # 48 69 65 72 6F 70 68 61 6E 74 32
                # Note: To begin Journey type man afterboot,man help,man hier[.]
                # 66 6F 72 20 48 69 72 65 0000 0001
                // "Who's Afraid of Schrodinger's Cat?" /var/(.)?mail/me \? ;-]

                --
                Reporting bugs: http://perl.apache.org/bugs/
                Mail list info: http://perl.apache.org/maillist/modperl.html
                List etiquette: http://perl.apache.org/maillist/email-etiquette.html
              • Geoffrey Young
                ... lookup_uri() will issue a subrequest that includes URI- filename translation. lookup_file() will skip over the translation part, setting $r- filename to
                Message 7 of 20 , Feb 3, 2004
                View Source
                • 0 Attachment
                  dreamwvr@... wrote:
                  > Hi All,
                  > Since lookup_uri() is only to be used when the actual
                  > URI physically exists. Having said that how does not tell
                  > it to pretend that a randomly generated virtual file exists?
                  > Is that what lookup_filename() is for?

                  lookup_uri() will issue a subrequest that includes URI->filename
                  translation. lookup_file() will skip over the translation part, setting
                  $r->filename to the file you pass in. I suppose that you could use this to
                  avoid the IO if you know the file doesn't exist, but I've never tried. from
                  the code it looks like it should work ok - $r->filename is set but
                  meaningless for dynamic documents anyway.

                  > I am wanting to do a
                  > internal_redirect() to a virtual file whose name is always
                  > changing. This way the Location is never the same twice.
                  > Any suggestions appreciated.

                  I don't see why you need to use either with internal_redirect() - just pass
                  it the URI and let Apache handle it. you would use a subrequest (initiated
                  from eather of the lookup functions) along with $sub->run() if you wanted to
                  send the contents of the subrequest along.

                  HTH

                  --Geoff


                  --
                  Reporting bugs: http://perl.apache.org/bugs/
                  Mail list info: http://perl.apache.org/maillist/modperl.html
                  List etiquette: http://perl.apache.org/maillist/email-etiquette.html
                • dreamwvr@dreamwvr.com
                  ... (For the archives since It might be useful info.. them again maybe not.:-) Well, I was hoping this was the case however this is what happens.. [...] $sub =
                  Message 8 of 20 , Feb 10, 2004
                  View Source
                  • 0 Attachment
                    On Tue, Feb 03, 2004 at 11:09:31AM -0500, Geoffrey Young wrote:
                    > I don't see why you need to use either with internal_redirect() - just pass
                    > it the URI and let Apache handle it. you would use a subrequest (initiated
                    > from eather of the lookup functions) along with $sub->run() if you wanted to
                    > send the contents of the subrequest along.
                    (For the archives since It might be useful info.. them again maybe not.:-)
                    Well, I was hoping this was the case however this is what happens..
                    [...]
                    $sub = $r->lookup_file("randfile.html");
                    $filename = $sub->filename();
                    [...]
                    $sub->internal_redirect($filename);
                    $sub->run() and return 'OK';

                    if($sub->run ne 'OK') {

                    $sub->log_error("Error running subrequest!");

                    }
                    Just tried this and I get the usual file_not_found page..
                    Not Found

                    The requested URL /var/www/htdocs/test/randfile.html was not found on this server.
                    FYI:
                    If one uses the internal_redir* with lookup_file() the above err is what occurs.
                    If one uses the internal_redir* with lookup_uri() and the file exists
                    one does get the page. So me thinks I am missing something obvious. Is it?
                    thought train was that subrequests make Apache reload the page as if it was
                    a completely new request. That way redirection would occur simularly to
                    META tags redirection when set to "0" seconds. Well back to it.

                    Best Regards,
                    dreamwvr@...



                    --
                    Reporting bugs: http://perl.apache.org/bugs/
                    Mail list info: http://perl.apache.org/maillist/modperl.html
                    List etiquette: http://perl.apache.org/maillist/email-etiquette.html
                  • Geoffrey Young
                    ... take a look at the internal_redirect docs - once you call internal_redirect you need to return OK - no additional logic is allowed. so, you can t both
                    Message 9 of 20 , Feb 10, 2004
                    View Source
                    • 0 Attachment
                      dreamwvr@... wrote:
                      > On Tue, Feb 03, 2004 at 11:09:31AM -0500, Geoffrey Young wrote:
                      >
                      >>I don't see why you need to use either with internal_redirect() - just pass
                      >>it the URI and let Apache handle it. you would use a subrequest (initiated
                      >>from eather of the lookup functions) along with $sub->run() if you wanted to
                      >>send the contents of the subrequest along.
                      >
                      > (For the archives since It might be useful info.. them again maybe not.:-)
                      > Well, I was hoping this was the case however this is what happens..
                      > [...]
                      > $sub = $r->lookup_file("randfile.html");
                      > $filename = $sub->filename();
                      > [...]
                      > $sub->internal_redirect($filename);
                      > $sub->run() and return 'OK';
                      >
                      > if($sub->run ne 'OK') {
                      >
                      > $sub->log_error("Error running subrequest!");
                      >
                      > }
                      > Just tried this and I get the usual file_not_found page..
                      > Not Found
                      >
                      > The requested URL /var/www/htdocs/test/randfile.html was not found on this server.
                      > FYI:
                      > If one uses the internal_redir* with lookup_file() the above err is what occurs.
                      > If one uses the internal_redir* with lookup_uri() and the file exists
                      > one does get the page. So me thinks I am missing something obvious. Is it?
                      > thought train was that subrequests make Apache reload the page as if it was
                      > a completely new request. That way redirection would occur simularly to
                      > META tags redirection when set to "0" seconds. Well back to it.

                      take a look at the internal_redirect docs - once you call internal_redirect
                      you need to return OK - no additional logic is allowed. so, you can't both
                      $sub->internal_redirect() and $sub->run().

                      basically, if in your content handler you want Apache to redirect to a
                      different URI use $r->internal_redirect.

                      if you want to test attributes of a given URI or file (say, whether the
                      current $r->remote_user would be able to view the file if they accessed it
                      directly), then you would create a subrequest with lookup_file() or
                      lookup_uri(). if you find that the subrequest passes your tests, you can
                      $sub->run() to send the file directly to the client, or call whatever logic
                      you like to send your own content to the client (including
                      $r->internal_redirect).

                      HTH

                      --Geoff


                      --
                      Reporting bugs: http://perl.apache.org/bugs/
                      Mail list info: http://perl.apache.org/maillist/modperl.html
                      List etiquette: http://perl.apache.org/maillist/email-etiquette.html
                    Your message has been successfully submitted and would be delivered to recipients shortly.