Why filters
This presentation is the property of its rightful owner.
Sponsored Links
1 / 25

Why filters? PowerPoint PPT Presentation


  • 86 Views
  • Uploaded on
  • Presentation posted in: General

Why filters?. Very flexible design Allows one module to modify the data that another module produces Finally, CGI's that output SSI tags A module that puts header and footer information on each page Many many more possibilities. Basic filters in 2.0. Core

Download Presentation

Why filters?

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


Why filters

Why filters?

  • Very flexible design

  • Allows one module to modify the data that another module produces

    • Finally, CGI's that output SSI tags

    • A module that puts header and footer information on each page

    • Many many more possibilities


Basic filters in 2 0

Basic filters in 2.0

  • Core

    • core_input_filter (read from network)

    • core_output_filter (write to network)

    • byterange_filter (send partial result)

    • content_length_filter (compute C-L)

    • sub-request_filter (remove extra EOS)

    • OLD_WRITE (buffer for ap_r* funcs)


Basic filters in 2 01

Basic filters in 2.0

  • HTTPD

    • HTTP_IN (header/body determination)

    • HTTP_HEADER (send headers)

    • CHUNK (send data in chunks)

    • DECHUNK (read chunked body from client)

  • Modules

    • SSI_filter (parse files for SSI tags)


Basic filters in 2 02

Basic filters in 2.0

  • Modules

    • SSI_filter (parse files for SSI tags)

    • External (run external programs)

    • Charset-encoding (translate between charsets)


Possible additional filters

Possible Additional Filters

  • SSL (in process of being written, input and output)

  • Header/Footer (basic attempt in presentation and handouts)

  • Cache (cache data in output filter, send it later from cache_handler, basic attempt in CVS)


Handlers and filters

Handlers and filters

  • Handlers are the first filter in the chain

    • Filters use functions like ap_fwrite

    • Handlers use ap_rwrite

  • Handlers Generate data from nothing

  • Filters modify data passed to them from handlers, and other filters


Buckets and brigades

Buckets and brigades


Types of buckets

File

Pool

MMAP

EOS

Flush

Error

Types of buckets

  • Heap

  • Transient

  • Immortal

  • Pipe

  • Socket


Assumptions

Assumptions

  • All data can be broken into chunks

    • Each chunk of data must come from the same source

  • All HTTP data can be represented as strings of characters, even if not human readable

  • Filters must allow for optimal performance, even if they don't enforce it

    • If files are in the output stream, then we should use sendfile


Bucket functions

Bucket Functions

  • apr_bucket_*_create

    • Different arguments for each bucket type

  • apr_bucket_split

  • apr_bucket_destroy

  • apr_bucket_copy

  • apr_bucket_setaside


Bucket creation

Bucket Creation


Bucket split

Bucket Split


Bucket copy

Bucket copy


Brigade functions

Brigade Functions

  • apr_brigade_create

  • apr_brigade_split

    • Splits based on buckets

  • apr_brigade_partition

    • Splits based on offset

  • apr_brigade_destroy

  • apr_brigade_write, putstrs, vputstrs, putc, etc

    • Write into a brigade with buffering


Apr brigade write

apr_brigade_write


Apr brigade write foo

apr_brigade_write("foo")


Apr brigade write bar

apr_brigade_write("bar")


Input filter flow

Input Filter flow


Apcon filter in

apcon_filter_in


Apcon filter in1

apcon_filter_in


Apcon filter in2

apcon_filter_in


Generator filter flow

generator/filter flow


Header footer filter

Header/Footer Filter


Header footer filter1

Header/Footer Filter


More information

More Information

  • Slides on-line

    • Http://www.ntrnet.net/~rbb/presentations

  • Articles

    • http://www.apachetoday.com

    • http://www.covalent.net/

  • General Information

    • http://www.apache.org

    • [email protected]


  • Login