1POE::Filter::HTTPChunk(U3s)er Contributed Perl DocumentatPiOoEn::Filter::HTTPChunk(3)
2
3
4
5my $TEXT = qr/[^[:cntrl:]]/o; my $qdtext = qr/[^[:cntrl:]\"]/o; #<any TEXT
6except <">> my $quoted_pair = qr/\\[[:ascii:]]/o; my $quoted_string =
7qr/\"(?:$qdtext⎪$quoted_pair)\"/o; my $separators = "[^()<>@,;:\\"\/\[\]\?={}
8\t"; my $notoken = qr/(?:[[:cntrl:]$separators]/o;
9
10 my $chunk_ext_name = $token; my $chunk_ext_val =
11 qr/(?:$token⎪$quoted_string)/o;
12
13 my $chunk_extension = qr/(?:;$chunk_ext_name(?:$chunk_ext_val)?)/o;
14
15 sub put {
16 die "not implemented yet"; }
17
19 POE::Filter::HTTPChunk - Non-blocking incremental HTTP chunk parser.
20
22 # Not a complete program.
23 use POE::Filter::HTTPChunk;
24 use POE::Wheel::ReadWrite;
25 sub setup_io {
26 $_[HEAP]->{io_wheel} = POE::Wheel::ReadWrite->new(
27 Filter => POE::Filter::HTTPChunk->new(),
28 # See POE::Wheel::ReadWrite for other required parameters.
29 );
30 }
31
33 This filter parses HTTP chunks from a data stream. It's used by
34 POE::Component::Client::HTTP to do the bulk of the low-level HTTP pars‐
35 ing.
36
38 new
39
40 "new" takes no parameters and returns a shiny new POE::Fil‐
41 ter::HTTPChunk object ready to use.
42
44 POE::Filter::HTTPChunk supports the following methods. Most of them
45 adhere to the standard POE::Filter API. The documentation for
46 POE::Filter explains the API in more detail.
47
48 get_one_start ARRAYREF
49
50 Accept an arrayref containing zero or more raw data chunks. They are
51 added to the filter's input buffer. The filter will attempt to parse
52 that data when get_one() is called.
53
54 $filter_httpchunk->get_one_start(\@stream_data);
55
56 get_one
57
58 Parse a single HTTP chunk from the filter's input buffer. Data is
59 entered into the buffer by the get_one_start() method. Returns an
60 arrayref containing zero or one parsed HTTP chunk.
61
62 $ret_arrayref = $filter_httpchunk->get_one();
63
64 get_pending
65
66 Returns an arrayref of stream data currently pending parsing. It's
67 used to seamlessly transfer unparsed data between an old and a new fil‐
68 ter when a wheel's filter is changed.
69
70 $pending_arrayref = $filter_httpchunk->get_pending();
71
73 POE::Filter, POE.
74
76 None are known at this time.
77
79 POE::Filter::HTTPChunk is...
80
81 · Copyright 2005-2006 Martijn van Beers
82
83 · Copyright 2006 Rocco Caputo
84
85 All rights are reserved. POE::Filter::HTTPChunk is free software; you
86 may redistribute it and/or modify it under the same terms as Perl
87 itself.
88
90 Rocco may be contacted by e-mail via <mailto:rcaputo@cpan.org>, and
91 Martijn may be contacted by email via <mailto:martijn@cpan.org>.
92
93 The preferred way to report bugs or requests is through RT though. See
94 <http://rt.cpan.org/NoAuth/Bugs.html?Dist=POE-Component-Client-HTTP> or
95 mail <mailto:bug-POE-Component-Client-HTTP@rt.cpan.org>
96
97 For questions, try the POE mailing list (poe@perl.org)
98
99
100
101perl v5.8.8 2006-10-14 POE::Filter::HTTPChunk(3)