diff options
author | Eric Wong <e@yhbt.net> | 2020-01-24 09:43:52 +0000 |
---|---|---|
committer | Eric Wong <e@yhbt.net> | 2020-01-25 19:34:21 +0000 |
commit | da0bddd3a5c573cd4623d1c95ebf4ee6dd87ed27 (patch) | |
tree | a3dc89216b42ff0393c4889dfc1b12e25df5281a /scripts/import_slrnspool | |
parent | aaf85aef560bc828b6e0fedb5a7632e8c47d7228 (diff) | |
download | public-inbox-da0bddd3a5c573cd4623d1c95ebf4ee6dd87ed27.tar.gz |
This prevents public-inbox-httpd from buffering ->getline results from a static file into another temporary file when writing to slow clients. Instead we inject the static file ref with offsets and length directly into the {wbuf} queue. It took me a while to decide to go this route, some rejected ideas: 1. Using Plack::Util::set_io_path and having PublicInbox::HTTP serve the result directly. This is compatible with what some other PSGI servers do using sendfile. However, neither Starman or Twiggy currently use sendfile for partial responses. 2. Parsing the Content-Range response header for offsets and lengths to use with set_io_path for partial responses. These rejected ideas required increasing the complexity of HTTP response writing in PublicInbox::HTTP in the common, non-static file cases. Instead, we made minor changes to the colder write buffering path of PublicInbox::DS and leave the hot paths untouched. We still support generic PSGI servers via ->getline. However, since we don't know the characteristics of other PSGI servers, we no longer do a 64K initial read in an attempt to negotiate a larger TCP window.
Diffstat (limited to 'scripts/import_slrnspool')
0 files changed, 0 insertions, 0 deletions