📄 apr::bucket.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::APR::Bucket 3".TH mod_perl-2.0.2::docs::api::APR::Bucket 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"APR::Bucket \- Perl API for manipulating APR Buckets.SH "Synopsis".IX Header "Synopsis".Vb 2\& use APR::Bucket ();\& my $ba = $c\->bucket_alloc;\& \& $b1 = APR::Bucket\->new($ba, "aaa");\& $b2 = APR::Bucket::eos_create($ba);\& $b3 = APR::Bucket::flush_create($ba);\& \& $b2\->is_eos;\& $b3\->is_flush;\& \& $len = $b1\->length;\& $len = $b1\->read($data);\& $type = $b1\->type;\& \& $b1\->insert_after($b2);\& $b1\->insert_before($b3);\& $b1\->remove;\& $b1\->destroy;\& \& $b2\->delete; # remove+destroy\& \& $b4 = APR::Bucket\->new($ba, "to be setaside");\& $b4\->setaside($pool);.Ve.SH "Description".IX Header "Description"\&\f(CW\*(C`APR::Bucket\*(C'\fR allows you to create, manipulate and delete \s-1APR\s0buckets..PPYou will probably find the various insert methods confusing, the tipis to read the function right to left. The following code sample helpsto visualize the operations:.PP.Vb 12\& my $bb = APR::Brigade\->new($r\->pool, $ba);\& my $d1 = APR::Bucket\->new($ba, "d1");\& my $d2 = APR::Bucket\->new($ba, "d2");\& my $f1 = APR::Bucket::flush_create($ba);\& my $f2 = APR::Bucket::flush_create($ba);\& my $e1 = APR::Bucket::eos_create($ba);\& # head\->tail\& $bb\->insert_head( $d1); # head\->d1\->tail\& $d1\->insert_after( $d2); # head\->d1\->d2\->tail\& $d2\->insert_before($f1); # head\->d1\->f1\->d2\->tail\& $d2\->insert_after( $f2); # head\->d1\->f1\->d2\->f2\->tail\& $bb\->insert_tail( $e1); # head\->d1\->f1\->d2\->f2\->e1\->tail.Ve.SH "API".IX Header "API"\&\f(CW\*(C`APR::Bucket\*(C'\fR provides the following functions and/or methods:.ie n .Sh """delete""".el .Sh "\f(CWdelete\fP".IX Subsection "delete"Tell the bucket to remove itself from the bucket brigade it belongsto, and destroy itself..PP.Vb 1\& $bucket\->delete();.Ve.ie n .IP "obj: $bucket\fR ( \f(CW""APR::Bucket object"" )" 4.el .IP "obj: \f(CW$bucket\fR ( \f(CWAPR::Bucket object\fR )" 4.IX Item "obj: $bucket ( APR::Bucket 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.PPIf the bucket is not attached to any bucket brigade then thisoperation just destroys the bucket..PP\&\f(CW\*(C`delete\*(C'\fR is a convenience wrapper, internally doing:.PP.Vb 2\& $b\->remove;\& $b\->destroy;.Ve.PPExamples:.PPAssuming that \f(CW$bb\fR already exists and filled with buckets, replacethe existing data buckets with new buckets with upcased data;.PP.Vb 8\& for (my $b = $bb\->first; $b; $b = $bb\->next($b)) {\& if ($b\->read(my $data)) {\& my $nb = APR::Bucket\->new($bb\->bucket_alloc, uc $data);\& $b\->insert_before($nb);\& $b\->delete;\& $b = $nb;\& }\& }.Ve.ie n .Sh """destroy""".el .Sh "\f(CWdestroy\fP".IX Subsection "destroy"Free the resources used by a bucket. If multiple buckets refer to thesame resource it is freed when the last one goes away..PP.Vb 1\& $bucket\->destroy();.Ve.ie n .IP "obj: $bucket\fR ( \f(CW""APR::Bucket object"" )" 4.el .IP "obj: \f(CW$bucket\fR ( \f(CWAPR::Bucket object\fR )" 4.IX Item "obj: $bucket ( APR::Bucket 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.PPA bucket needs to be destroyed if it was removed from abucket brigade, to avoid memory leak..PPIf a bucket is linked to a bucket brigade, it needs to beremoved from it, before it can be destroyed..PPUsually instead of calling:.PP.Vb 2\& $b\->remove;\& $b\->destroy;.Ve.PPit's better to call \f(CW\*(C`delete\*(C'\fR which does exactly that..ie n .Sh """eos_create""".el .Sh "\f(CWeos_create\fP".IX Subsection "eos_create"Create an \fIEndOfStream\fR bucket..PP.Vb 1\& $b = APR::Bucket::eos_create($ba);.Ve.ie n .IP "arg1: $ba\fR ( \f(CW""APR::BucketAlloc object"" )" 4.el .IP "arg1: \f(CW$ba\fR ( \f(CWAPR::BucketAlloc object\fR )" 4.IX Item "arg1: $ba ( APR::BucketAlloc object )"The freelist from which this bucket should be allocated.ie n .IP "ret: $b\fR ( \f(CW""APR::Bucket object"" )" 4.el .IP "ret: \f(CW$b\fR ( \f(CWAPR::Bucket object\fR )" 4.IX Item "ret: $b ( APR::Bucket object )"The new bucket.IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PPThis bucket type indicates that there is no more data coming from downthe filter stack. All filters should flush any buffered data at thispoint..PPExample:.PP.Vb 4\& use APR::Bucket ();\& use Apache2::Connection ();\& my $ba = $c\->bucket_alloc;\& my $eos_b = APR::Bucket::eos_create($ba);.Ve.ie n .Sh """flush_create""".el .Sh "\f(CWflush_create\fP".IX Subsection "flush_create"Create a flush bucket..PP.Vb 1\& $b = APR::Bucket::flush_create($ba);.Ve.ie n .IP "arg1: $ba\fR ( \f(CW""APR::BucketAlloc object"" )" 4.el .IP "arg1: \f(CW$ba\fR ( \f(CWAPR::BucketAlloc object\fR )" 4.IX Item "arg1: $ba ( APR::BucketAlloc object )"The freelist from which this bucket should be allocated.ie n .IP "ret: $b\fR ( \f(CW""APR::Bucket object"" )" 4.el .IP "ret: \f(CW$b\fR ( \f(CWAPR::Bucket object\fR )" 4.IX Item "ret: $b ( APR::Bucket object )"The new bucket.IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PPThis bucket type indicates that filters should flush their data.There is no guarantee that they will flush it, but this is the best wecan do..ie n .Sh """insert_after""".el .Sh "\f(CWinsert_after\fP".IX Subsection "insert_after"Insert a list of buckets after a specified bucket.PP.Vb 1\& $after_bucket\->insert_after($add_bucket);.Ve.ie n .IP "obj: $after_bucket\fR ( \f(CW""APR::Bucket object"" )" 4.el .IP "obj: \f(CW$after_bucket\fR ( \f(CWAPR::Bucket object\fR )" 4.IX Item "obj: $after_bucket ( APR::Bucket object )"The bucket to insert after.ie n .IP "arg1: $add_bucket\fR ( \f(CW""APR::Bucket object"" )" 4.el .IP "arg1: \f(CW$add_bucket\fR ( \f(CWAPR::Bucket object\fR )" 4.IX Item "arg1: $add_bucket ( APR::Bucket object )"The buckets to insert. It says buckets, since \f(CW$add_bucket\fR may havemore buckets attached after itself..IP "ret: no return value" 4.IX Item "ret: no return value".PD 0.IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PD.ie n .Sh """insert_before""".el .Sh "\f(CWinsert_before\fP".IX Subsection "insert_before"Insert a list of buckets before a specified bucket.PP.Vb 1\& $before_bucket\->insert_before($add_bucket);.Ve.ie n .IP "obj: $before_bucket\fR ( \f(CW""APR::Bucket object"" )" 4.el .IP "obj: \f(CW$before_bucket\fR ( \f(CWAPR::Bucket object\fR )" 4.IX Item "obj: $before_bucket ( APR::Bucket object )"The bucket to insert before.ie n .IP "arg1: $add_bucket\fR ( \f(CW""APR::Bucket object"" )" 4.el .IP "arg1: \f(CW$add_bucket\fR ( \f(CWAPR::Bucket object\fR )" 4.IX Item "arg1: $add_bucket ( APR::Bucket object )"The buckets to insert. It says buckets, since \f(CW$add_bucket\fR may havemore buckets attached after itself..IP "ret: no return value" 4.IX Item "ret: no return value".PD 0.IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PD.ie n .Sh """is_eos""".el .Sh "\f(CWis_eos\fP".IX Subsection "is_eos"Determine if a bucket is an \s-1EOS\s0 bucket.PP.Vb 1\& $ret = $bucket\->is_eos();.Ve.ie n .IP "obj: $bucket\fR ( \f(CW""APR::Bucket object"" )" 4.el .IP "obj: \f(CW$bucket\fR ( \f(CWAPR::Bucket object\fR )" 4.IX Item "obj: $bucket ( APR::Bucket object )".PD 0.ie n .IP "ret: $ret ( boolean )" 4.el .IP "ret: \f(CW$ret\fR ( boolean )" 4.IX Item "ret: $ret ( boolean )".IP "since: 2.0.00" 4.IX Item "since: 2.0.00".PD.ie n .Sh """is_flush""".el .Sh "\f(CWis_flush\fP"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -