You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs-cvs@perl.apache.org by st...@apache.org on 2002/11/17 06:28:40 UTC

cvs commit: modperl-docs/src/docs/2.0/user/handlers filters.pod http.pod server.pod

stas        2002/11/16 21:28:40

  Modified:    src/docs/2.0/user/handlers filters.pod http.pod server.pod
  Log:
  a few minor code fixes, mostly missing 'use ' for modules that were
  preloaded and therefore not noticed.
  
  Revision  Changes    Path
  1.4       +14 -4     modperl-docs/src/docs/2.0/user/handlers/filters.pod
  
  Index: filters.pod
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/docs/2.0/user/handlers/filters.pod,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- filters.pod	17 Nov 2002 02:54:04 -0000	1.3
  +++ filters.pod	17 Nov 2002 05:28:40 -0000	1.4
  @@ -176,6 +176,7 @@
     
     use Apache::RequestRec ();
     use Apache::RequestIO ();
  +  use APR::Table ();
     
     use Apache::Const -compile => qw(OK M_POST);
     
  @@ -526,8 +527,8 @@
     
     use base qw(Apache::Filter);
     
  -  use Apache::RequestRec ();
  -  use Apache::RequestIO ();
  +  use Apache::Connection ();
  +  use Apache::ServerUtil ();
     use APR::Brigade ();
     use APR::Bucket ();
     
  @@ -607,14 +608,23 @@
     use strict;
     use warnings;
     
  +  use Apache::RequestIO ();
  +  use Apache::RequestRec ();
  +  use Apache::Response ();
  +  
     use Apache::Const -compile => 'OK';
     
     sub handler {
         my $r = shift;
  +  
         $r->content_type('text/plain');
  -      $r->print("the request type was " . $r->method);
  +      my $response = "the request type was " . $r->method;
  +      $r->set_content_length(length $response);
  +      $r->print($response);
  +  
         Apache::OK;
     }
  +  
     1;
   
   which returns to the client the request type it has issued. In the
  @@ -739,7 +749,7 @@
   
   When issuing a POST request:
   
  - % echo "mOd_pErl RuLeS" | POST 'http://localhost:8002/dump_input?FoO=1&BAR=2'
  + % echo "mOd_pErl RuLeS" | POST 'http://localhost:8002/lc_input?FoO=1&BAR=2'
   
   we get a response:
   
  
  
  
  1.5       +15 -5     modperl-docs/src/docs/2.0/user/handlers/http.pod
  
  Index: http.pod
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/docs/2.0/user/handlers/http.pod,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- http.pod	12 Nov 2002 17:04:37 -0000	1.4
  +++ http.pod	17 Nov 2002 05:28:40 -0000	1.5
  @@ -319,7 +319,7 @@
         my $r = shift;
     
         my %headers = map {$_ => $r->headers_in->get($_)} qw(To From Subject);
  -      my $content = $r->content;
  +      my $content = content($r);
     
         my $status = send_email(\%headers, \$content);
     
  @@ -377,7 +377,7 @@
   
   The function terminates the header_parser phase by:
   
  -    return Apache::OK;
  +      return Apache::OK;
   
   All other phases run as usual, so you can reuse any HTTP protocol
   hooks, such as authentication and fixup phases. 
  @@ -596,6 +596,9 @@
     use strict;
     use warnings;
     
  +  use Apache::Access ();
  +  use Apache::RequestUtil ();
  +  
     use Apache::Const -compile => qw(OK DECLINED AUTH_REQUIRED);
   
     use Apache::Access();
  @@ -703,6 +706,9 @@
     use strict;
     use warnings;
     
  +  use Apache::Access ();
  +  use Apache::RequestUtil ();
  +  
     use Apache::Const -compile => qw(OK AUTH_REQUIRED);
   
     use Apache::Access ();
  @@ -718,7 +724,8 @@
         my $user = $r->user;
         if ($user) {
             my($section) = $r->uri =~ m|^/company/(\w+)/|;
  -          if (my $users = $protected{$section}) {
  +          if (defined $section && exists $protected{$section}) {
  +              my $users = $protected{$section};
                 return Apache::OK if grep { $_ eq $user } @$users;
             }
             else {
  @@ -757,7 +764,7 @@
     <Location /company/>
         SetHandler perl-script
         PerlResponseHandler ModPerl::Registry
  -      PerlAuthenHandler MyApache::SecretPhraseAuth
  +      PerlAuthenHandler MyApache::SecretLengthAuth
         PerlAuthzHandler  MyApache::SecretResourceAuthz
         Options +ExecCGI
     
  @@ -844,6 +851,9 @@
     use strict;
     use warnings;
     
  +  use Apache::RequestIO ();
  +  use Apache::RequestRec ();
  +  
     use Apache::Const -compile => 'OK';
     
     use constant HANDLER  => 0;
  @@ -923,7 +933,7 @@
   
   Here is how this handler is configured:
   
  -  Alias /dispatch/ /home/httpd/dispatch/
  +  Alias /dispatch/ /home/httpd/httpd-2.0/htdocs/
     <Location /dispatch/>
         PerlFixupHandler MyApache::FileExtDispatch
     </Location>
  
  
  
  1.2       +1 -0      modperl-docs/src/docs/2.0/user/handlers/server.pod
  
  Index: server.pod
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/docs/2.0/user/handlers/server.pod,v
  retrieving revision 1.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- server.pod	2 Sep 2002 06:34:51 -0000	1.1
  +++ server.pod	17 Nov 2002 05:28:40 -0000	1.2
  @@ -55,6 +55,7 @@
     use warnings;
     
     use Apache::Log ();
  +  use Apache::ServerUtil ();
     
     use File::Spec::Functions;
     
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-cvs-unsubscribe@perl.apache.org
For additional commands, e-mail: docs-cvs-help@perl.apache.org