⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 apache2::filter.3

📁 视频监控网络部分的协议ddns,的模块的实现代码,请大家大胆指正.
💻 3
📖 第 1 页 / 共 3 页
字号:
.\" Automatically generated by Pod::Man 2.16 (Pod::Simple 3.05).\".\" Standard preamble:.\" ========================================================================.de Sh \" Subsection heading.br.if t .Sp.ne 5.PP\fB\\$1\fR.PP...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" '''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 turned on, we'll generate index entries on stderr for.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index.\" entries marked with X<> in POD.  Of course, you'll have to process the.\" output yourself in some meaningful fashion..ie \nF \{\.    de IX.    tm Index:\\$1\t\\n%\t"\\$2"...    nr % 0.    rr F.\}.el \{\.    de IX...\}.\".\" 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 "mod_perl-2.0.2::docs::api::Apache2::Filter 3".TH mod_perl-2.0.2::docs::api::Apache2::Filter 3 "2005-10-21" "perl v5.10.0" "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::Filter \- Perl API for Apache 2.0 Filtering.SH "Synopsis".IX Header "Synopsis".Vb 1\&  use Apache2::Filter ();\&  \&  # filter attributes\&  my $c = $f\->c;\&  my $r = $f\->r;\&  my $frec = $f\->frec();\&  my $next_f = $f\->next;\&  \&  my $ctx = $f\->ctx;\&  $f\->ctx($ctx);\&  \&  # bucket brigade filtering API\&  $rc = $f\->next\->get_brigade($bb, $mode, $block, $readbytes);\&  $rc = $f\->next\->pass_brigade($bb);\&  $rc = $f\->fflush($bb);\&  \&  # streaming filtering API\&  while ($filter\->read(my $buffer, $wanted)) {\&      # transform $buffer here\&      $filter\->print($buffer);\&  }\&  if ($f\->seen_eos) {\&      $filter\->print("filter signature");\&  }\&  \&  # filter manipulations\&  $r\->add_input_filter(\e&callback);\&  $c\->add_input_filter(\e&callback);\&  $r\->add_output_filter(\e&callback);\&  $c\->add_output_filter(\e&callback);\&  $f\->remove;.Ve.SH "Description".IX Header "Description"\&\f(CW\*(C`Apache2::Filter\*(C'\fR provides Perl \s-1API\s0 for Apache 2.0 filteringframework..PPMake sure to read \f(CW\*(C`the Filteringtutorial|docs::2.0::user::handlers::filters\*(C'\fR..SH "Common Filter API".IX Header "Common Filter API"The following methods can be called from any filter handler:.ie n .Sh """c""".el .Sh "\f(CWc\fP".IX Subsection "c"Get the current connection object from a connection or a requestfilter:.PP.Vb 1\&  $c = $f\->c;.Ve.ie n .IP "obj: $f\fR ( \f(CW""Apache2::Filter object"" )" 4.el .IP "obj: \f(CW$f\fR ( \f(CWApache2::Filter object\fR )" 4.IX Item "obj: $f ( Apache2::Filter object )".PD 0.ie n .IP "ret: $c\fR ( \f(CW""Apache2::Connection object"" )" 4.el .IP "ret: \f(CW$c\fR ( \f(CWApache2::Connection object\fR )" 4.IX Item "ret: $c ( Apache2::Connection object )".IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PD.ie n .Sh """ctx""".el .Sh "\f(CWctx\fP".IX Subsection "ctx"Get/set the filter context data..PP.Vb 2\&  $ctx = $f\->ctx;\&         $f\->ctx($ctx);.Ve.ie n .IP "obj: $f\fR ( \f(CW""Apache2::Filter object"" )" 4.el .IP "obj: \f(CW$f\fR ( \f(CWApache2::Filter object\fR )" 4.IX Item "obj: $f ( Apache2::Filter object )".PD 0.ie n .IP "opt arg2: $ctx ( \s-1SCALAR\s0 )" 4.el .IP "opt arg2: \f(CW$ctx\fR ( \s-1SCALAR\s0 )" 4.IX Item "opt arg2: $ctx ( SCALAR )".PDnext context.ie n .IP "ret: $ctx ( \s-1SCALAR\s0 )" 4.el .IP "ret: \f(CW$ctx\fR ( \s-1SCALAR\s0 )" 4.IX Item "ret: $ctx ( SCALAR )"current context.IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PPA filter context is created before the filter is called for the firsttime and it's destroyed at the end of the request. The context ispreserved between filter invocations of the same request. So if afilter needs to store some data between invocations it should use thefilter context for that.  The filter context is initialized with the\&\f(CW\*(C`undef\*(C'\fR value..PPThe \f(CW\*(C`ctx\*(C'\fR method accepts a single \s-1SCALAR\s0 argument. Therefore if youwant to store any other perl datastructure you should use a referenceto it..PPFor example you can store a hash reference:.PP.Vb 1\&  $f\->ctx({ foo => \*(Aqbar\*(Aq });.Ve.PPand then access it:.PP.Vb 1\&  $foo = $f\->ctx\->{foo};.Ve.PPif you access the context more than once it's more efficient to copyit's value before using it:.PP.Vb 2\&  my $ctx = $f\->ctx;\&  $foo = $ctx\->{foo};.Ve.PPto avoid redundant method calls. As of this writing \f(CW$ctx\fR is not atied variable, so if you modify it need to store it at the end:.PP.Vb 1\&  $f\->ctx($ctx);.Ve.PP\&\s-1META:\s0 later we might make it a TIEd-variable interface, so it'll bestored automatically..PPBesides its primary purpose of storing context data across multiplefilter invocations, this method is also useful when used as aflag. For example here is how to ensure that something happens onlyonce during the filter's life:.PP.Vb 4\&  unless ($f\->ctx) {\&      do_something_once();\&      $f\->ctx(1);\&  }.Ve.ie n .Sh """frec""".el .Sh "\f(CWfrec\fP".IX Subsection "frec"Get/set the \f(CW\*(C`Apache2::FilterRec\*(C'\fR(filter record) object..PP.Vb 1\&  $frec = $f\->frec();.Ve.ie n .IP "obj: $f\fR ( \f(CW""Apache2::Filter object"" )" 4.el .IP "obj: \f(CW$f\fR ( \f(CWApache2::Filter object\fR )" 4.IX Item "obj: $f ( Apache2::Filter object )".PD 0.ie n .IP "ret: $frec\fR ( \f(CW""Apache2::FilterRec object"" )" 4.el .IP "ret: \f(CW$frec\fR ( \f(CWApache2::FilterRec object\fR )" 4.IX Item "ret: $frec ( Apache2::FilterRec object )".IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PD.PPFor example you can call\&\f(CW\*(C`$frec\->name\*(C'\fR to getfilter's name..ie n .Sh """next""".el .Sh "\f(CWnext\fP".IX Subsection "next"Return the \f(CW\*(C`Apache2::Filter\*(C'\fR object of the next filter in chain..PP.Vb 1\&  $next_f = $f\->next;.Ve.ie n .IP "obj: $f\fR ( \f(CW""Apache2::Filter object"" )" 4.el .IP "obj: \f(CW$f\fR ( \f(CWApache2::Filter object\fR )" 4.IX Item "obj: $f ( Apache2::Filter object )"The current filter object.ie n .IP "ret: $next_f\fR ( \f(CW""Apache2::Filter object"" )" 4.el .IP "ret: \f(CW$next_f\fR ( \f(CWApache2::Filter object\fR )" 4.IX Item "ret: $next_f ( Apache2::Filter object )"The next filter object in chain.IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PPSince Apache inserts several core filters at the end of each chain,normally this method always returns an object. However if it's not amod_perl filter handler, you can call only the following methods onit: \f(CW\*(C`get_brigade\*(C'\fR,\&\f(CW\*(C`pass_brigade\*(C'\fR, \f(CW\*(C`c\*(C'\fR, \f(CW\*(C`r\*(C'\fR,\&\f(CW\*(C`frec\*(C'\fR and \f(CW\*(C`next\*(C'\fR. If you call other methodsthe behavior is undefined..PPThe next filter can be a mod_perl one or not, it's easy to tell whichone is that by calling\&\f(CW\*(C`$f\->frec\->name\*(C'\fR..ie n .Sh """r""".el .Sh "\f(CWr\fP".IX Subsection "r"Inside an \s-1HTTP\s0 request filter retrieve the current request object:.PP.Vb 1\&  $r = $f\->r;.Ve.ie n .IP "obj: $f\fR ( \f(CW""Apache2::Filter object"" )" 4.el .IP "obj: \f(CW$f\fR ( \f(CWApache2::Filter object\fR )" 4.IX Item "obj: $f ( Apache2::Filter object )".PD 0.ie n .IP "ret: $r\fR ( \f(CW""Apache2::RequestRec object"" )" 4.el .IP "ret: \f(CW$r\fR ( \f(CWApache2::RequestRec object\fR )" 4.IX Item "ret: $r ( Apache2::RequestRec object )".IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PD.PPIf a sub-request adds filters, then that sub-request object isassociated with the filter..ie n .Sh """remove""".el .Sh "\f(CWremove\fP".IX Subsection "remove"Remove the current filter from the filter chain (for the currentrequest or connection)..PP.Vb 1\&  $f\->remove;.Ve.ie n .IP "obj: $f\fR ( \f(CW""Apache2::Filter object"" )" 4.el .IP "obj: \f(CW$f\fR ( \f(CWApache2::Filter object\fR )" 4.IX Item "obj: $f ( Apache2::Filter object )".PD 0.IP "ret: no return value" 4.IX Item "ret: no return value".IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PD.PPNotice that you should either complete the current filter invocationnormally (by calling \f(CW\*(C`get_brigade\*(C'\fR or\&\f(CW\*(C`pass_brigade\*(C'\fR depending on the filter kind) orif nothing was done, return \f(CW\*(C`Apache2::Const::DECLINED\*(C'\fR and mod_perl will take

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -