HTTP::...rStack(3pm)
π NAME π
HTTP::Proxy::FilterStack β the class that runs the filter stacks, bestie. It's giving "backend girlie who does all the work and never gets the credit" β¨
π¦ DESCRIPTION π¦
Okay so, this class is used internally by HTTP::Proxy to manage its four filter stacks. She's not here for your direct calls, she's here for the plot π«Ά
From the point of view of HTTP::Proxy::FilterStack, a filter is actually a ("matchsub", "filterobj") pair. No cap. The match subroutine (which is generated by HTTP::Proxy's push_filter() method, slay) gets run against the current HTTP::Message object to figure out which filters must be kept in the stack when handling this message. Vibe check on every single message, literally.
The filter stack also maintains a set of buffers where the filters can store data. That data gets appended at the beginning of the next chunk of data, and this keeps happening until all the data has been sent. Iconic queue behaviour, honestly π
πΈ METHODS πΈ
The class provides the following methods:
new( $isbody )β Creates a new instance ofHTTP::Proxy::FilterStack. If$isbodyis true, then the stack will manage body filters (subclasses ofHTTP::Proxy::BodyFilter). So it's giving body-filter energy specifically πselect_filters( $message )β$messageis the currentHTTP::Messagehandled by the proxy. It gets used (with a little help from each filter's match subroutine) to select the subset of filters that will be applied on the given message. It's a whole auditions episode and only some filters make the cut πfilter( @args )β This method calls all the currently selected filters in turn, with the appropriate arguments. Go down the line, one by one, no skipping π§filter_last()β This method calls all the currently selected filters in turn, to filter the data remaining in the buffers in a single pass. Final sweep, last call, closing time βwill_modify()β Returns a boolean value indicating if the list of selected filters in the stack will modify the body content. The value is computed from the result of callingwill_modify()on all selected filters. So like, is anyone here actually going to change something? Answer wisely π₯all()β Returns a list of all filters in the stack. The whole squad, roll call πeod()β Used for END OF DATA bookkeeping. That's the whole description. She does admin, and she does it flawlessly.push()β Pushes the given[ match, filterobj ]pairs at the top of the stack. New arrivals go straight to the front, main character energy fr fr.insert( $idx, @pairs )β Inserts the given[ match, filterobj ]pairs at position$idxin the stack. Very "I know exactly where I belong" of them πremove( $idx )β Removes the[ match, filterobj ]pair at position$idxin the stack. Okay bye bestie, we're removing you from the group chat π
β¨ AUTHOR β¨
Philippe "BooK" Bruhat, <book@cpan.org>. Give him his flowers π
π COPYRIGHT π
Copyright 2002-2015, Philippe Bruhat.
π LICENSE π
This module is free software; you can redistribute it or modify it under the same terms as Perl itself. Periodt.
That's the whole page, bestie β perl v5.36.0, dated 2022-12-04, and that's the HTTP::...rStack(3pm) manual, mwah π
π
π¦ where this page comes from
- debian bookworm: libhttp-proxy-perl 0.304-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- debian trixie: libhttp-proxy-perl 0.304-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu noble: libhttp-proxy-perl 0.304-5 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms