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/12 18:04:38 UTC

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

stas        2002/11/12 09:04:37

  Modified:    src/docs/2.0/user/handlers filters.pod http.pod intro.pod
                        protocols.pod
  Log:
  a bunch of minor corrections
  
  Revision  Changes    Path
  1.2       +12 -12    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.1
  retrieving revision 1.2
  diff -u -r1.1 -r1.2
  --- filters.pod	2 Sep 2002 06:34:51 -0000	1.1
  +++ filters.pod	12 Nov 2002 17:04:37 -0000	1.2
  @@ -360,10 +360,10 @@
   
     % echo "mod_perl rules" | POST 'http://localhost:8008/dump?foo=1&bar=2'
   
  -We get the same response, because our snooping filter didn't change
  -anything. Though there was a lot of output printed to I<error_log>. We
  -present it all here, since it helps a lot to understand how filters
  -work.
  +We get the same response, when using C<MyApache::FilterSnoop>, because
  +our snooping filter didn't change anything. Though there was a lot of
  +output printed to I<error_log>. We present it all here, since it helps
  +a lot to understand how filters work.
   
   First we can see the connection input filter at work, as it processes
   the HTTP headers. We can see that for this request each header is put
  @@ -412,9 +412,9 @@
   
   Here the HTTP header has been terminated by a double new line. So far
   all the buckets were of the I<HEAP> type, meaning that they were
  -allocated from the heap memory. Notice that the request input filters
  -will never see the bucket brigade with HTTP header, it has been
  -consumed by the last connection Apache core handler.
  +allocated from the heap memory. Notice that the HTTP request input
  +filters will never see the bucket brigade with HTTP headers, as it has
  +been consumed by the last core connection filter.
   
   The following two entries are generated when
   C<MyApache::Dump::handler> reads the POSTed content:
  @@ -431,8 +431,8 @@
   
   as we saw earlier on the diagram, the connection input filter is run
   before the request input filter. Since our connection input filter was
  -passing the data through unmodified and no other connection input
  -filter was configured, the request input filter sees the same
  +passing the data through unmodified and no other custom connection
  +input filter was configured, the request input filter sees the same
   data. The last bucket in the brigade received by the request input
   filter is of type I<EOS>, meaning that all the input data from the
   current request has been received.
  @@ -776,7 +776,7 @@
   brigades manipulation or the simplified stream-oriented interface.
   
   First let's develop a response handler that send two lines of output:
  -numerals 0-9 and the English alphabet in a single string:
  +numerals 1234567890 and the English alphabet in a single string:
   
     file:MyApache/SendAlphaNum.pm
     -------------------------------
  @@ -795,7 +795,7 @@
     
         $r->content_type('text/plain');
     
  -      $r->print(0..9, "0\n");
  +      $r->print(1..9, "0\n");
         $r->print('a'..'z', "\n");
     
         Apache::OK;
  @@ -805,7 +805,7 @@
   The purpose of our request output filter is to reverse every line of
   the response, preserving the new line characters in their
   places. Since we want to reverse characters only in the response body
  -we will use the request output filters.
  +we will use the HTTP request output filter.
   
   
   
  
  
  
  1.4       +22 -21    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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- http.pod	9 Oct 2002 08:58:29 -0000	1.3
  +++ http.pod	12 Nov 2002 17:04:37 -0000	1.4
  @@ -208,7 +208,7 @@
     
     use strict;
     use warnings;
  -
  +  
     use Apache::RequestRec ();
     
     use Apache::Const -compile => qw(DECLINED);
  @@ -277,8 +277,8 @@
   think of emails, they are very similar to HTTP messages: they have a
   set of headers and a body, sometimes a multi-part body. Therefore we
   can develop a handler that extends HTTP by adding a support for the
  -C<EMAIL> method.  We can enable this protocol extension during and
  -push the real content handler during the
  +C<EMAIL> method.  We can enable this protocol extension and push the
  +real content handler during the
   C<L<PerlHeaderParserHandler|/PerlHeaderParserHandler>> phase:
   
     <Location /email>
  @@ -456,7 +456,7 @@
   When configured inside any container directive, except
   C<E<lt>VirtualHostE<gt>>, this handler is an alias for
   C<L<PerlHeaderParserHandler|/PerlHeaderParserHandler>> described
  -later.  Otherwise it acts as an alias for
  +earlier.  Otherwise it acts as an alias for
   C<L<PerlPostReadRequestHandler|/PerlPostReadRequestHandler>> described
   earlier.
   
  @@ -475,9 +475,10 @@
     PerlSetVar ReloadAll Off
     PerlSetVar ReloadModules "MyApache::*"
   
  -which will monitor and reload all C<MyApache::*> modules that have
  -been modified since the last request. However if we move the global
  -configuration into a C<E<lt>LocationE<gt>> container:
  +which during the current HTTP request will monitor and reload all
  +C<MyApache::*> modules that have been modified since the last HTTP
  +request. However if we move the global configuration into a
  +C<E<lt>LocationE<gt>> container:
   
     <Location /devel>
         PerlInitHandler Apache::Reload
  @@ -516,7 +517,7 @@
   C<Apache::FORBIDDEN> if the access is not allowed, otherwise return
   C<Apache::OK>.
   
  -The following example handler blocks requests made from IPs on the
  +The following example handler denies requests made from IPs on the
   blacklist.
   
     file:MyApache/BlockByIP.pm
  @@ -571,11 +572,11 @@
   
   This phase is usually used to verify a user's identification
   credentials. If the credentials are verified to be correct, the
  -handler should return C<OK>.  Otherwise the handler returns
  -C<AUTH_REQUIRED> to indicate that the user has not authenticated
  -successfully.  When Apache sends the HTTP header with this code, the
  -browser will normally pop up a dialog box that prompts the user for
  -login information.
  +handler should return C<Apache::OK>.  Otherwise the handler returns
  +C<Apache::AUTH_REQUIRED> to indicate that the user has not
  +authenticated successfully.  When Apache sends the HTTP header with
  +this code, the browser will normally pop up a dialog box that prompts
  +the user for login information.
   
   This phase is of type
   C<L<RUN_FIRST|docs::2.0::user::handlers::intro/item_RUN_FIRST>>.
  @@ -691,7 +692,7 @@
   The handler's configuration scope is
   C<L<DIR|docs::2.0::user::config::config/item_DIR>>.
   
  -Here is the C<MyApache::SecretResourceAuthz> handler which allows an
  +Here is the C<MyApache::SecretResourceAuthz> handler which grants
   access to certain resources only to certain users who have already
   properly authenticated:
   
  @@ -858,7 +859,7 @@
     sub handler {
         my $r = shift;
     
  -      my ($ext) = $r->uri =~ /\.(\w+)$/;
  +      my($ext) = $r->uri =~ /\.(\w+)$/;
         $ext = 'txt' unless defined $ext and exists $exts{$ext};
     
         $r->handler($exts{$ext}->[HANDLER]);
  @@ -936,7 +937,7 @@
   =head2 PerlResponseHandler
   
   The I<handler> (I<response>) phase is used for generating the
  -response. This is probably the most important phase and most of the
  +response. This is arguably the most important phase and most of the
   existing Apache modules do most of their work at this phase.
   
   This is the only phase that requires two directives under
  @@ -944,12 +945,12 @@
   
     <Location /perl>
        SetHandler perl-script
  -     PerlResponseHandler Apache::Registry
  +     PerlResponseHandler ModPerl::Registry
     </Location>
   
   C<SetHandler> set to
  -L<C<perl-script>|docs::2.0::user::config::config/perl_script> or
  -L<C<modperl>|docs::2.0::user::config::config/modperl> tells Apache
  +C<L<perl-script|docs::2.0::user::config::config/perl_script>> or
  +C<L<modperl|docs::2.0::user::config::config/modperl>> tells Apache
   that mod_perl is going to handle the response
   generation. C<PerlResponseHandler> tells mod_perl which callback is
   going to do the job.
  @@ -1009,8 +1010,8 @@
         return 0;
     }
   
  -if you compare it to the source code, it's pretty much the
  -same. C<B::Deparse> is fun to play with!
  +If you compare it to the source code, it's pretty much the same
  +code. C<B::Deparse> is fun to play with!
   
   
   
  
  
  
  1.3       +2 -2      modperl-docs/src/docs/2.0/user/handlers/intro.pod
  
  Index: intro.pod
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/docs/2.0/user/handlers/intro.pod,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- intro.pod	2 Sep 2002 06:47:12 -0000	1.2
  +++ intro.pod	12 Nov 2002 17:04:37 -0000	1.3
  @@ -196,8 +196,8 @@
   cannot tell the history of the brigade, it can only see the existing
   buckets in the brigade.
   
  -Bucket brigades are discussed in detail in the L<connection
  -protocols|docs::2.0::user::handlers::protocols> and L<I/O
  +Bucket brigades are discussed in detail in the L<protocol
  +handlers|docs::2.0::user::handlers::protocols> and L<I/O
   filtering|docs::2.0::user::handlers::filters> chapters.
   
   
  
  
  
  1.3       +14 -10    modperl-docs/src/docs/2.0/user/handlers/protocols.pod
  
  Index: protocols.pod
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/docs/2.0/user/handlers/protocols.pod,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- protocols.pod	12 Nov 2002 09:19:11 -0000	1.2
  +++ protocols.pod	12 Nov 2002 17:04:37 -0000	1.3
  @@ -13,7 +13,7 @@
   As we saw earlier, each child server (be it a thread or a process) is
   engaged in processing connections. Each connection may be served by
   different connection protocols, e.g., HTTP, POP3, SMTP, etc. Each
  -connection may include more then one request, e.g., several HTTP
  +connection may include more than one request, e.g., several HTTP
   requests can be served over a single connection, when several images
   are requested for the same webpage.
   
  @@ -181,12 +181,14 @@
     
         my $buff;
         while (1) {
  -          my($rlen, $wlen);
  -          $rlen = BUFF_LEN;
  +          my $rlen = BUFF_LEN;
             $socket->recv($buff, $rlen);
  +  
             last if $rlen <= 0 or $buff =~ /^[\r\n]+$/;
  -          $wlen = $rlen;
  +  
  +          my $wlen = $rlen;
             $socket->send($buff, $wlen);
  +  
             last if $wlen != $rlen;
         }
     
  @@ -206,9 +208,9 @@
   Inside the read/send loop, the handler attempts to read C<BUFF_LEN>
   bytes from the client socket into the C<$buff> buffer.  The C<$rlen>
   parameter will be set to the number of bytes actually read.  The
  -C<APR::Socket::recv()> method returns an APR status value, be we need
  -only check the read length to break out of the loop if it is less than
  -or equal to C<0> bytes. The handler also breaks the loop after
  +C<APR::Socket::recv()> method returns an APR status value, but we need
  +only to check the read length to break out of the loop if it is less
  +than or equal to C<0> bytes. The handler also breaks the loop after
   processing an input including nothing but new lines characters, which
   is how we abort the connection in the interactive mode.
   
  @@ -257,9 +259,11 @@
   
     Connection closed by foreign host.
   
  -As you can see the response which is now was all in lower case,
  -because of the output filter. And here is the implementation of the
  -connection and the filter handlers.
  +As you can see the response now was all in lower case, because of the
  +output filter.
  +
  +And here is the implementation of the connection and the filter
  +handlers.
   
     file:MyApache/EchoBB.pm
     -----------------------
  
  
  

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