perl-docs-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject cvs commit: modperl-docs/src/docs/2.0/api/Apache Connection.pod Const.pod
Date Thu, 26 Feb 2004 21:00:38 GMT
stas        2004/02/26 13:00:38

  Modified:    src/docs/2.0/api/Apache Connection.pod Const.pod
  Log:
  $c->keepalive and the corresponding :conn_keepalive constants
  documentation
  
  Revision  Changes    Path
  1.3       +34 -2     modperl-docs/src/docs/2.0/api/Apache/Connection.pod
  
  Index: Connection.pod
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/Connection.pod,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -u -r1.2 -r1.3
  --- Connection.pod	15 Jan 2004 01:08:49 -0000	1.2
  +++ Connection.pod	26 Feb 2004 21:00:38 -0000	1.3
  @@ -150,7 +150,8 @@
   
   =head2 C<keepalive>
   
  -Are we going to keep the connection alive for another request?
  +This method answers the question: Are we going to keep the connection
  +alive for another HTTP request? It's relevant only for HTTP requests.
   
     $status = $c->keepalive();
   
  @@ -158,10 +159,41 @@
   
   =item arg1: C<$c> (C<L<Apache::Connection|docs::2.0::api::Apache::Connection>>)
   
  -=item ret: C<$status> (integer)
  +=item ret: C<$status> (C<L<:conn_keepalive
  +constant|docs::2.0::api::Apache::Const/C__conn_keepalive_>>)
  +
  +The method does B<not> return true or false, but one of the states
  +which can be compared against (C<L<:conn_keepalive
  +constants|docs::2.0::api::Apache::Const/C__conn_keepalive_>>).
  +
  +=item since: 1.99_13
   
   =back
   
  +For example:
  +
  +  use Apache::RequestRec ();
  +  use Apache::Connection ();
  +  
  +  use Apache::Const -compile => qw(:conn_keepalive);
  +  ...
  +  my $c = $r->connection;
  +  if ($c->keepalive == Apache::CONN_KEEPALIVE) {
  +      # do something
  +  }
  +  elsif ($c->keepalive == Apache::CONN_CLOSE) {
  +      # do something else
  +  }
  +  elsif ($c->keepalive == Apache::CONN_UNKNOWN) {
  +      # do yet something else
  +  }
  +  else {
  +      # die "unknown state";
  +  }
  +
  +Notice that new states could be added later by Apache, so your code
  +should make no assumptions and do things only if the desired state
  +matches.
   
   
   
  
  
  
  1.6       +31 -0     modperl-docs/src/docs/2.0/api/Apache/Const.pod
  
  Index: Const.pod
  ===================================================================
  RCS file: /home/cvs/modperl-docs/src/docs/2.0/api/Apache/Const.pod,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -u -r1.5 -r1.6
  --- Const.pod	14 Jan 2004 09:23:47 -0000	1.5
  +++ Const.pod	26 Feb 2004 21:00:38 -0000	1.6
  @@ -129,6 +129,37 @@
   
   
   
  +
  +=head2 C<:conn_keepalive>
  +
  +  use Apache::Const -compile => qw(:conn_keepalive);
  +
  +The C<:conn_keepalive> group is used by the
  +(C<L<$c-E<gt>keepalive|docs::2.0::api::Apache::Connection/C_keepalive_>>)
  +method.
  +
  +=head3 C<Apache::CONN_UNKNOWN>
  +
  +The connection is at an unknown state, e.g., initialized but not open
  +yet.
  +
  +since: 1.99_13
  +
  +=head3 C<Apache::CONN_CLOSE>
  +
  +The connection will be closed at the end of the current HTTP request.
  +
  +since: 1.99_13
  +
  +=head3 C<Apache::CONN_KEEPALIVE>
  +
  +The connection will be kept alive at the end of the current HTTP request.
  +
  +since: 1.99_13
  +
  +
  +
  +
   =head2 C<:http>
   
     use Apache::Const -compile => qw(:http);
  
  
  

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


Mime
View raw message