.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "libapache2-mod-perl2-2.0.11::docs::api::Apache2::Connection 3pm" .TH libapache2-mod-perl2-2.0.11::docs::api::Apache2::Connection 3pm "2021-02-22" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Apache2::Connection \- Perl API for Apache connection object .SH "Synopsis" .IX Header "Synopsis" .Vb 2 \& use Apache2::Connection (); \& use Apache2::RequestRec (); \& \& my $c = $r\->connection; \& \& my $c = $r\->connection; \& # is connection still open? \& $status = $c\->aborted; \& \& # base server \& $base_server = $c\->base_server(); \& \& # needed for creating buckets/brigades \& $ba = $c\->bucket_alloc(); \& \& # client\*(Aqs socket \& $socket = $c\->client_socket; \& \& # unique connection id \& $id = $c\->id(); \& \& # connection filters stack \& $input_filters = $c\->input_filters(); \& $output_filters = $c\->output_filters(); \& \& # keep the connection alive? \& $status = $c\->keepalive(); \& \& # how many requests served over the current connection \& $served = $c\->keepalives(); \& \& # this connection\*(Aqs local and remote socket addresses \& $local_sa = $c\->local_addr(); \& $remote_sa = $c\->remote_addr(); \& \& # local and remote hostnames \& $local_host = $c\->local_host(); \& $remote_host = $c\->get_remote_host(); \& $remote_host = $c\->remote_host(); \& \& # server and remote client\*(Aqs IP addresses \& $local_ip = $c\->local_ip(); \& $remote_ip = $c\->remote_ip(); \& \& # connection level Apache notes \& $notes = $c\->notes(); \& \& # this connection\*(Aqs pool \& $p = $c\->pool(); .Ve .SH "Description" .IX Header "Description" \&\f(CW\*(C`Apache2::RequestRec\*(C'\fR provides the Perl \s-1API\s0 for Apache connection record object. .SH "API" .IX Header "API" \&\f(CW\*(C`Apache2::Connection\*(C'\fR provides the following functions and/or methods: .ie n .SS """aborted""" .el .SS "\f(CWaborted\fP" .IX Subsection "aborted" Check whether the connection is still open .PP .Vb 1 \& $status = $c\->aborted(); .Ve .ie n .IP "obj: $c ( ""Apache2::Connection object"" )" 4 .el .IP "obj: \f(CW$c\fR ( \f(CWApache2::Connection object\fR )" 4 .IX Item "obj: $c ( Apache2::Connection object )" .PD 0 .ie n .IP "ret: $status ( boolean )" 4 .el .IP "ret: \f(CW$status\fR ( boolean )" 4 .IX Item "ret: $status ( boolean )" .PD true if the connection has been aborted, false if still open .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .ie n .SS """base_server""" .el .SS "\f(CWbase_server\fP" .IX Subsection "base_server" Physical server this connection came in on (main server or vhost): .PP .Vb 1 \& $base_server = $c\->base_server(); .Ve .ie n .IP "obj: $c ( ""Apache2::Connection object"" )" 4 .el .IP "obj: \f(CW$c\fR ( \f(CWApache2::Connection object\fR )" 4 .IX Item "obj: $c ( Apache2::Connection object )" .PD 0 .ie n .IP "ret: $base_server ( ""Apache2::Server object"" )" 4 .el .IP "ret: \f(CW$base_server\fR ( \f(CWApache2::Server object\fR )" 4 .IX Item "ret: $base_server ( Apache2::Server object )" .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .PD .ie n .SS """bucket_alloc""" .el .SS "\f(CWbucket_alloc\fP" .IX Subsection "bucket_alloc" The bucket allocator to use for all bucket/brigade creations .PP .Vb 1 \& $ba = $c\->bucket_alloc(); .Ve .ie n .IP "obj: $c ( ""Apache2::Connection object"" )" 4 .el .IP "obj: \f(CW$c\fR ( \f(CWApache2::Connection object\fR )" 4 .IX Item "obj: $c ( Apache2::Connection object )" .PD 0 .ie n .IP "ret: $ba ( ""APR::BucketAlloc object"" )" 4 .el .IP "ret: \f(CW$ba\fR ( \f(CWAPR::BucketAlloc object\fR )" 4 .IX Item "ret: $ba ( APR::BucketAlloc object )" .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .PD .PP This object is needed by \f(CW\*(C`APR::Bucket\*(C'\fR and \f(CW\*(C`APR::Brigade\*(C'\fR methods/functions. .ie n .SS """client_socket""" .el .SS "\f(CWclient_socket\fP" .IX Subsection "client_socket" Get/set the client socket .PP .Vb 2 \& $socket = $c\->client_socket; \& $prev_socket = $c\->client_socket($new_socket); .Ve .ie n .IP "obj: $c ( ""Apache2::Connection object"" )" 4 .el .IP "obj: \f(CW$c\fR ( \f(CWApache2::Connection object\fR )" 4 .IX Item "obj: $c ( Apache2::Connection object )" .PD 0 .ie n .IP "opt arg1: $new_socket ( ""APR::Socket object"" object )" 4 .el .IP "opt arg1: \f(CW$new_socket\fR ( \f(CWAPR::Socket object\fR object )" 4 .IX Item "opt arg1: $new_socket ( APR::Socket object object )" .PD If passed a new socket will be set. .ie n .IP "ret: $socket ( ""APR::Socket object"" object )" 4 .el .IP "ret: \f(CW$socket\fR ( \f(CWAPR::Socket object\fR object )" 4 .IX Item "ret: $socket ( APR::Socket object object )" current client socket .Sp if the optional argument \f(CW$new_socket\fR was passed the previous socket object is returned. .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .ie n .SS """get_remote_host""" .el .SS "\f(CWget_remote_host\fP" .IX Subsection "get_remote_host" Lookup the client's \s-1DNS\s0 hostname or \s-1IP\s0 address .PP .Vb 3 \& $remote_host = $c\->remote_host(); \& $remote_host = $c\->remote_host($type); \& $remote_host = $c\->remote_host($type, $dir_config); .Ve .ie n .IP "obj: $c ( ""Apache2::Connection object"" )" 4 .el .IP "obj: \f(CW$c\fR ( \f(CWApache2::Connection object\fR )" 4 .IX Item "obj: $c ( Apache2::Connection object )" The current connection .ie n .IP "opt arg1: $type ( "":remotehost constant"" )" 4 .el .IP "opt arg1: \f(CW$type\fR ( \f(CW:remotehost constant\fR )" 4 .IX Item "opt arg1: $type ( :remotehost constant )" The type of lookup to perform: .RS 4 .ie n .IP """Apache2::Const::REMOTE_DOUBLE_REV""" 4 .el .IP "\f(CWApache2::Const::REMOTE_DOUBLE_REV\fR" 4 .IX Item "Apache2::Const::REMOTE_DOUBLE_REV" will always force a \s-1DNS\s0 lookup, and also force a double reverse lookup, regardless of the \f(CW\*(C`HostnameLookups\*(C'\fR setting. The result is the (double reverse checked) hostname, or undef if any of the lookups fail. .ie n .IP """Apache2::Const::REMOTE_HOST""" 4 .el .IP "\f(CWApache2::Const::REMOTE_HOST\fR" 4 .IX Item "Apache2::Const::REMOTE_HOST" returns the hostname, or \f(CW\*(C`undef\*(C'\fR if the hostname lookup fails. It will force a \s-1DNS\s0 lookup according to the \f(CW\*(C`HostnameLookups\*(C'\fR setting. .ie n .IP """Apache2::Const::REMOTE_NAME""" 4 .el .IP "\f(CWApache2::Const::REMOTE_NAME\fR" 4 .IX Item "Apache2::Const::REMOTE_NAME" returns the hostname, or the dotted quad if the hostname lookup fails. It will force a \s-1DNS\s0 lookup according to the \f(CW\*(C`HostnameLookups\*(C'\fR setting. .ie n .IP """Apache2::Const::REMOTE_NOLOOKUP""" 4 .el .IP "\f(CWApache2::Const::REMOTE_NOLOOKUP\fR" 4 .IX Item "Apache2::Const::REMOTE_NOLOOKUP" is like \f(CW\*(C`Apache2::Const::REMOTE_NAME\*(C'\fR except that a \s-1DNS\s0 lookup is never forced. .RE .RS 4 .Sp Default value is \f(CW\*(C`Apache2::Const::REMOTE_NAME\*(C'\fR. .RE .ie n .IP "opt arg2: $dir_config ( ""Apache2::ConfVector object"" )" 4 .el .IP "opt arg2: \f(CW$dir_config\fR ( \f(CWApache2::ConfVector object\fR )" 4 .IX Item "opt arg2: $dir_config ( Apache2::ConfVector object )" The directory config vector from the request. It's needed to find the container in which the directive \f(CW\*(C`HostnameLookups\*(C'\fR is set. To get one for the current request use \&\f(CW\*(C`$r\->per_dir_config\*(C'\fR. .Sp By default, \f(CW\*(C`undef\*(C'\fR is passed, in which case it's the same as if \&\f(CW\*(C`HostnameLookups\*(C'\fR was set to \f(CW\*(C`Off\*(C'\fR. .ie n .IP "ret: $remote_host ( string/undef )" 4 .el .IP "ret: \f(CW$remote_host\fR ( string/undef )" 4 .IX Item "ret: $remote_host ( string/undef )" The remote hostname. If the configuration directive \&\fBHostNameLookups\fR is set to off, this returns the dotted decimal representation of the client's \s-1IP\s0 address instead. Might return \&\f(CW\*(C`undef\*(C'\fR if the hostname is not known. .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .PP The result of \f(CW\*(C`get_remote_host\*(C'\fR call is cached in \&\f(CW\*(C`$c\->remote_host\*(C'\fR. If the latter is set, \&\f(CW\*(C`get_remote_host\*(C'\fR will return that value immediately, w/o doing any checkups. .ie n .SS """id""" .el .SS "\f(CWid\fP" .IX Subsection "id" \&\s-1ID\s0 of this connection; unique at any point in time .PP .Vb 1 \& $id = $c\->id(); .Ve .ie n .IP "obj: $c ( ""Apache2::Connection object"" )" 4 .el .IP "obj: \f(CW$c\fR ( \f(CWApache2::Connection object\fR )" 4 .IX Item "obj: $c ( Apache2::Connection object )" .PD 0 .ie n .IP "ret: $id (integer)" 4 .el .IP "ret: \f(CW$id\fR (integer)" 4 .IX Item "ret: $id (integer)" .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .PD .ie n .SS """input_filters""" .el .SS "\f(CWinput_filters\fP" .IX Subsection "input_filters" Get/set the first filter in a linked list of protocol level input filters: .PP .Vb 2 \& $input_filters = $c\->input_filters(); \& $prev_input_filters = $c\->input_filters($new_input_filters); .Ve .ie n .IP "obj: $c ( ""Apache2::Connection object"" )" 4 .el .IP "obj: \f(CW$c\fR ( \f(CWApache2::Connection object\fR )" 4 .IX Item "obj: $c ( Apache2::Connection object )" .PD 0 .ie n .IP "opt arg1: $new_input_filters" 4 .el .IP "opt arg1: \f(CW$new_input_filters\fR" 4 .IX Item "opt arg1: $new_input_filters" .PD Set a new value .ie n .IP "ret: $input_filters ( ""Apache2::Filter object"" )" 4 .el .IP "ret: \f(CW$input_filters\fR ( \f(CWApache2::Filter object\fR )" 4 .IX Item "ret: $input_filters ( Apache2::Filter object )" The first filter in the connection input filters chain. .Sp If \f(CW$new_input_filters\fR was passed, returns the previous value. .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .PP For an example see: Bucket Brigades-based Protocol Module .ie n .SS """keepalive""" .el .SS "\f(CWkeepalive\fP" .IX Subsection "keepalive" This method answers the question: Should the the connection be kept alive for another \s-1HTTP\s0 request after the current request is completed? .PP .Vb 2 \& $status = $c\->keepalive(); \& $status = $c\->keepalive($new_status); .Ve .ie n .IP "obj: $c ( ""Apache2::Connection object"" )" 4 .el .IP "obj: \f(CW$c\fR ( \f(CWApache2::Connection object\fR )" 4 .IX Item "obj: $c ( Apache2::Connection object )" .PD 0 .ie n .IP "opt arg1: $new_status ( "":conn_keepalive constant"" )" 4 .el .IP "opt arg1: \f(CW$new_status\fR ( \f(CW:conn_keepalive constant\fR )" 4 .IX Item "opt arg1: $new_status ( :conn_keepalive constant )" .PD Normally you should not mess with setting this option when handling the \s-1HTTP\s0 protocol. If you do (for example when sending your own headers set with \&\f(CW\*(C`$r\->assbackwards\*(C'\fR) \&\*(-- take a look at the \fBap_set_keepalive()\fR function in \&\fIhttpd\-2.0/modules/http/http_protocol.c\fR. .ie n .IP "ret: $status ( "":conn_keepalive constant"" )" 4 .el .IP "ret: \f(CW$status\fR ( \f(CW:conn_keepalive constant\fR )" 4 .IX Item "ret: $status ( :conn_keepalive constant )" The method does \fBnot\fR return true or false, but one of the states which can be compared against (\f(CW\*(C`:conn_keepalive constants\*(C'\fR). .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .PP Unless you set this value yourself when implementing non-HTTP protocols, it's only relevant for \s-1HTTP\s0 requests. .PP For example: .PP .Vb 2 \& use Apache2::RequestRec (); \& use Apache2::Connection (); \& \& use Apache2::Const \-compile => qw(:conn_keepalive); \& ... \& my $c = $r\->connection; \& if ($c\->keepalive == Apache2::Const::CONN_KEEPALIVE) { \& # do something \& } \& elsif ($c\->keepalive == Apache2::Const::CONN_CLOSE) { \& # do something else \& } \& elsif ($c\->keepalive == Apache2::Const::CONN_UNKNOWN) { \& # do yet something else \& } \& else { \& # die "unknown state"; \& } .Ve .PP 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. .ie n .SS """keepalives""" .el .SS "\f(CWkeepalives\fP" .IX Subsection "keepalives" How many requests were already served over the current connection. .PP .Vb 2 \& $served = $c\->keepalives(); \& $served = $c\->keepalives($new_served); .Ve .ie n .IP "obj: $c ( ""Apache2::Connection object"" )" 4 .el .IP "obj: \f(CW$c\fR ( \f(CWApache2::Connection object\fR )" 4 .IX Item "obj: $c ( Apache2::Connection object )" .PD 0 .ie n .IP "opt arg1: $new_served (integer)" 4 .el .IP "opt arg1: \f(CW$new_served\fR (integer)" 4 .IX Item "opt arg1: $new_served (integer)" .PD Set the number of served requests over the current connection. Normally you won't do that when handling \s-1HTTP\s0 requests. (But see below a note regarding \&\f(CW\*(C`$r\->assbackwards\*(C'\fR). .ie n .IP "ret: $served (integer)" 4 .el .IP "ret: \f(CW$served\fR (integer)" 4 .IX Item "ret: $served (integer)" How many requests were already served over the current connection. .Sp In most handlers, but \s-1HTTP\s0 output filter handlers, that value doesn't count the current request. For the latter it'll count the current request. .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .PP This method is only relevant for keepalive connections. The core connection output filter \&\f(CW\*(C`ap_http_header_filter\*(C'\fR increments this value when the response headers are sent and it decides that the connection should not be closed (see \f(CW\*(C`ap_set_keepalive()\*(C'\fR). .PP If you send your own set of \s-1HTTP\s0 headers with \&\f(CW\*(C`$r\->assbackwards\*(C'\fR, which includes the \f(CW\*(C`Keep\-Alive\*(C'\fR \s-1HTTP\s0 response header, you must make sure to increment the \f(CW\*(C`keepalives\*(C'\fR counter. .ie n .SS """local_addr""" .el .SS "\f(CWlocal_addr\fP" .IX Subsection "local_addr" Get this connection's local socket address .PP .Vb 1 \& $local_sa = $c\->local_addr(); .Ve .ie n .IP "obj: $c ( ""Apache2::Connection object"" )" 4 .el .IP "obj: \f(CW$c\fR ( \f(CWApache2::Connection object\fR )" 4 .IX Item "obj: $c ( Apache2::Connection object )" .PD 0 .ie n .IP "ret: $local_sa ( ""APR::SockAddr object"" )" 4 .el .IP "ret: \f(CW$local_sa\fR ( \f(CWAPR::SockAddr object\fR )" 4 .IX Item "ret: $local_sa ( APR::SockAddr object )" .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .PD .ie n .SS """local_host""" .el .SS "\f(CWlocal_host\fP" .IX Subsection "local_host" used for ap_get_server_name when UseCanonicalName is set to \s-1DNS\s0 (ignores setting of HostnameLookups) .PP .Vb 1 \& $local_host = $c\->local_host(); .Ve .ie n .IP "obj: $c ( ""Apache2::Connection object"" )" 4 .el .IP "obj: \f(CW$c\fR ( \f(CWApache2::Connection object\fR )" 4 .IX Item "obj: $c ( Apache2::Connection object )" .PD 0 .ie n .IP "ret: $local_host (string)" 4 .el .IP "ret: \f(CW$local_host\fR (string)" 4 .IX Item "ret: $local_host (string)" .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .PD .PP \&\s-1META:\s0 you probably shouldn't use this method, but ( \&\f(CW\*(C`get_server_name\*(C'\fR ) if inside request and \f(CW$r\fR is available. .ie n .SS """local_ip""" .el .SS "\f(CWlocal_ip\fP" .IX Subsection "local_ip" server \s-1IP\s0 address .PP .Vb 1 \& $local_ip = $c\->local_ip(); .Ve .ie n .IP "obj: $c ( ""Apache2::Connection object"" )" 4 .el .IP "obj: \f(CW$c\fR ( \f(CWApache2::Connection object\fR )" 4 .IX Item "obj: $c ( Apache2::Connection object )" .PD 0 .ie n .IP "ret: $local_ip (string)" 4 .el .IP "ret: \f(CW$local_ip\fR (string)" 4 .IX Item "ret: $local_ip (string)" .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .PD .ie n .SS """notes""" .el .SS "\f(CWnotes\fP" .IX Subsection "notes" Get/set text notes for the duration of this connection. These notes can be passed from one module to another (not only mod_perl, but modules in any other language): .PP .Vb 2 \& $notes = $c\->notes(); \& $prev_notes = $c\->notes($new_notes); .Ve .ie n .IP "obj: $c ( ""Apache2::Connection object"" )" 4 .el .IP "obj: \f(CW$c\fR ( \f(CWApache2::Connection object\fR )" 4 .IX Item "obj: $c ( Apache2::Connection object )" .PD 0 .ie n .IP "opt arg1: $new_notes ( ""APR::Table object"" )" 4 .el .IP "opt arg1: \f(CW$new_notes\fR ( \f(CWAPR::Table object\fR )" 4 .IX Item "opt arg1: $new_notes ( APR::Table object )" .ie n .IP "ret: $notes ( ""APR::Table object"" )" 4 .el .IP "ret: \f(CW$notes\fR ( \f(CWAPR::Table object\fR )" 4 .IX Item "ret: $notes ( APR::Table object )" .PD the current notes table. .Sp if the \f(CW$new_notes\fR argument was passed, returns the previous value. .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .PP Also see \&\f(CW\*(C`$r\->notes\*(C'\fR .ie n .SS """output_filters""" .el .SS "\f(CWoutput_filters\fP" .IX Subsection "output_filters" Get the first filter in a linked list of protocol level output filters: .PP .Vb 2 \& $output_filters = $c\->output_filters(); \& $prev_output_filters = $r\->output_filters($new_output_filters); .Ve .ie n .IP "obj: $c ( ""Apache2::Connection object"" )" 4 .el .IP "obj: \f(CW$c\fR ( \f(CWApache2::Connection object\fR )" 4 .IX Item "obj: $c ( Apache2::Connection object )" .PD 0 .ie n .IP "opt arg1: $new_output_filters" 4 .el .IP "opt arg1: \f(CW$new_output_filters\fR" 4 .IX Item "opt arg1: $new_output_filters" .PD Set a new value .ie n .IP "ret: $output_filters ( ""Apache2::Filter object"" )" 4 .el .IP "ret: \f(CW$output_filters\fR ( \f(CWApache2::Filter object\fR )" 4 .IX Item "ret: $output_filters ( Apache2::Filter object )" The first filter in the connection output filters chain. .Sp If \f(CW$new_output_filters\fR was passed, returns the previous value. .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .PP For an example see: Bucket Brigades-based Protocol Module .ie n .SS """pool""" .el .SS "\f(CWpool\fP" .IX Subsection "pool" Pool associated with this connection .PP .Vb 1 \& $p = $c\->pool(); .Ve .ie n .IP "obj: $c ( ""Apache2::Connection object"" )" 4 .el .IP "obj: \f(CW$c\fR ( \f(CWApache2::Connection object\fR )" 4 .IX Item "obj: $c ( Apache2::Connection object )" .PD 0 .ie n .IP "ret: $p ( ""APR::Pool object"" )" 4 .el .IP "ret: \f(CW$p\fR ( \f(CWAPR::Pool object\fR )" 4 .IX Item "ret: $p ( APR::Pool object )" .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .PD .ie n .SS """remote_addr""" .el .SS "\f(CWremote_addr\fP" .IX Subsection "remote_addr" Get this connection's remote socket address .PP .Vb 1 \& $remote_sa = $c\->remote_addr(); .Ve .ie n .IP "obj: $c ( ""Apache2::Connection object"" )" 4 .el .IP "obj: \f(CW$c\fR ( \f(CWApache2::Connection object\fR )" 4 .IX Item "obj: $c ( Apache2::Connection object )" .PD 0 .ie n .IP "ret: $remote_sa ( ""APR::SockAddr object"" )" 4 .el .IP "ret: \f(CW$remote_sa\fR ( \f(CWAPR::SockAddr object\fR )" 4 .IX Item "ret: $remote_sa ( APR::SockAddr object )" .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .PD .ie n .SS """remote_ip""" .el .SS "\f(CWremote_ip\fP" .IX Subsection "remote_ip" Client's \s-1IP\s0 address .PP .Vb 2 \& $remote_ip = $c\->remote_ip(); \& $prev_remote_ip = $c\->remote_ip($new_remote_ip); .Ve .ie n .IP "obj: $c ( ""Apache2::Connection object"" )" 4 .el .IP "obj: \f(CW$c\fR ( \f(CWApache2::Connection object\fR )" 4 .IX Item "obj: $c ( Apache2::Connection object )" .PD 0 .ie n .IP "opt arg1: $new_remote_ip ( string )" 4 .el .IP "opt arg1: \f(CW$new_remote_ip\fR ( string )" 4 .IX Item "opt arg1: $new_remote_ip ( string )" .PD If passed a new value will be set .ie n .IP "ret: $remote_ip ( string )" 4 .el .IP "ret: \f(CW$remote_ip\fR ( string )" 4 .IX Item "ret: $remote_ip ( string )" current remote ip address .Sp if the optional argument \f(CW$new_remote_ip\fR was passed the previous value is returned. .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .ie n .SS """remote_host""" .el .SS "\f(CWremote_host\fP" .IX Subsection "remote_host" Client's \s-1DNS\s0 name: .PP .Vb 1 \& $remote_host = $c\->remote_host(); .Ve .ie n .IP "obj: $c ( ""Apache2::Connection object"" )" 4 .el .IP "obj: \f(CW$c\fR ( \f(CWApache2::Connection object\fR )" 4 .IX Item "obj: $c ( Apache2::Connection object )" .PD 0 .ie n .IP "ret: $remote_host ( string/undef )" 4 .el .IP "ret: \f(CW$remote_host\fR ( string/undef )" 4 .IX Item "ret: $remote_host ( string/undef )" .PD If \f(CW\*(C`$c\->get_remote_host\*(C'\fR was run it returns the cached value, which is a client \s-1DNS\s0 name or \f(CW""\fR if it wasn't found. If the check wasn't run \*(-- \f(CW\*(C`undef\*(C'\fR is returned. .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .PP It's best to to call \f(CW\*(C`$c\->get_remote_host\*(C'\fR instead of directly accessing this variable. .SH "Unsupported API" .IX Header "Unsupported API" \&\f(CW\*(C`Apache2::Connection\*(C'\fR also provides auto-generated Perl interface for a few other methods which aren't tested at the moment and therefore their \s-1API\s0 is a subject to change. These methods will be finalized later as a need arises. If you want to rely on any of the following methods please contact the the mod_perl development mailing list so we can help each other take the steps necessary to shift the method to an officially supported \s-1API.\s0 .ie n .SS """conn_config""" .el .SS "\f(CWconn_config\fP" .IX Subsection "conn_config" Config vector containing pointers to connections per-server config structures .PP .Vb 1 \& $ret = $c\->conn_config(); .Ve .ie n .IP "obj: $c ( ""Apache2::Connection object"" )" 4 .el .IP "obj: \f(CW$c\fR ( \f(CWApache2::Connection object\fR )" 4 .IX Item "obj: $c ( Apache2::Connection object )" .PD 0 .ie n .IP "ret: $ret ( ""Apache2::ConfVector object"" )" 4 .el .IP "ret: \f(CW$ret\fR ( \f(CWApache2::ConfVector object\fR )" 4 .IX Item "ret: $ret ( Apache2::ConfVector object )" .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .PD .ie n .SS """sbh""" .el .SS "\f(CWsbh\fP" .IX Subsection "sbh" \&\s-1META:\s0 Autogenerated \- needs to be reviewed/completed .PP handle to scoreboard information for this connection .PP .Vb 1 \& $sbh = $c\->sbh(); .Ve .ie n .IP "obj: $c ( ""Apache2::Connection object"" )" 4 .el .IP "obj: \f(CW$c\fR ( \f(CWApache2::Connection object\fR )" 4 .IX Item "obj: $c ( Apache2::Connection object )" .PD 0 .ie n .IP "ret: $sbh (\s-1XXX\s0)" 4 .el .IP "ret: \f(CW$sbh\fR (\s-1XXX\s0)" 4 .IX Item "ret: $sbh (XXX)" .IP "since: 2.0.00" 4 .IX Item "since: 2.0.00" .PD .PP \&\s-1META:\s0 Not sure how this can be used from mod_perl at the moment. Unless \f(CW\*(C`Apache2::Scoreboard\*(C'\fR is extended to provide a hook to read from this variable. .SH "See Also" .IX Header "See Also" mod_perl 2.0 documentation. .SH "Copyright" .IX Header "Copyright" mod_perl 2.0 and its core modules are copyrighted under The Apache Software License, Version 2.0. .SH "Authors" .IX Header "Authors" The mod_perl development team and numerous contributors.