about summary refs log tree commit homepage
DateCommit message (Collapse)
2016-04-06examples/public-inbox.psgi: add note for our httpd
Default to maximizing compatibility in the example, but document the potential improvement if possible. Of course, using public-inbox-httpd out-of-the-box without a user-specified config file already enables chunked encoding by default.
2016-04-06http: clarify intent for persistence
We don't actually need to know if a response is chunked or what the actual Content-Length is; we just need to know if the PSGI app properly terminated the response so we can handle persistent connections.
2016-04-05view: link restructuring for index view
The "next/prev" links seem a bit awkward and I don't use them as much as I expected to. However, move the "raw" message link near the top since it's most useful for checking or reinforcing the validity of the message via GPG or just reading headers. Turn the Subject line into a permalink to the message, since that's probably the common behavior anyways for other messaging systems. Make the "[threaded|flat]" view links to always visible for bookmark-ability despite the lack of a "permalink" label.
2016-04-04http: fix condition for detecting persistence
Oops, we need to watch out for how we handle operator precedence and ensure responses without a Content-Length or "Transfer-Encoding: chunked" header will always disconnect after writing.
2016-04-02www: more explicit "git clone" usage
Little harm in having the entire command-line for users and avoiding the cognitive overhead of figuring out $URL.
2016-04-02www: various style changes and comment updates
Reduce stack depth of arguments and rely more on state hashref to store response state. We may end up shoving everything in ctx eventually.
2016-03-31httpd: remove reference to callback during close
Avoid wasting memory and the risk of a potential reference cycles by dropping the callback ASAP.
2016-03-17daemon: expand @ARGV paths for running in '/'
We also require --stdout/--stderr/--pid-file to be absolute paths for USR2 usage. However, allow PSGI files for -httpd to be relative paths for ease-of-use.
2016-03-12feed: fix brain farts in new_oneline removal
Ugh... Fixes: 476fc666c223 (reduce "PublicInbox::Hval->new_oneline" use)
2016-03-12searchmsg: preserve hard tabs, but drop CR (\r)
Hard tabs *may* be searchable, so preserve them since they do not take up any more space than a normal space. However, CR (carriage return) is worthless and likely a sign of a buggy mail (or spam) client anyways.
2016-03-12reduce "PublicInbox::Hval->new_oneline" use
It's probably a bad idea to strip extraneous whitespace from some headers as an extra space may convey useful information. Newlines don't seem to be preserved by Email::MIME or Email::Simple anyways, so there's no danger in breaking formatting.
2016-03-12http: use Plack::HTTPParser for HTTP parsing
This allows us to reduce installation dependencies while retaining performance as it favors HTTP::Parser::XS when it is installed and available. PLACK_HTTP_PARSER_PP may be set to 1 to force a pure Perl parser for testing.
2016-03-12examples: disable Chunked response in PSGI example
It seems incompatible with Starman and probably confuses other HTTP/1.0-only servers, too. Our -httpd will respect it and requires it for persistent connections.
2016-03-12http: prevent zero-byte writes
Plack::Middleware::Deflater (and perhaps other middleware) triggers zero-byte writes which wastes syscalls when they get passed to Danga::Socket. This may also trigger problems when we introduce TLS support in the future.
2016-03-11daemon: fixup usage of the '-l' switch with IP/INET6 sockets
We need to ensure $sock_pkg is preserved outside of the loop. The variable passed to "for" or "foreach" is implicitly local and restores the previous value when the loop exits. This is documented in the perlsyn manpage in the "Foreach Loops" section. Fixes: ea1b6cbd422b ("daemon: allow using IO::Socket::IP over INET6")
2016-03-08daemon: allow using IO::Socket::IP over INET6
IO::Socket::IP is bundled with newer versions of Perl, so it is more likely to be available. There should be no differences between these with our use cases.
2016-03-06http: reject excessively large HTTP request bodies
We cannot risk using all of a users' disk space buffering gigantic requests. Use the defaults git gives us since we primarily host git repositories.
2016-03-06http: ensure errors are printable before PSGI env
We cannot rely on a client socket having a PSGI env before headers are fully-parsed as we seek to avoid storing hashes for idle clients. Sso print errors to the psgi.errors value which belongs to the httpd listener, instead.
2016-03-06http: reject excessive headers
HTTP::Parser::XS::PP does not reject excessively large headers like the XS version. Ensure we reject headers over 16K since public-inbox should never need such large request headers.
2016-03-05daemon: sockname detects listeners correctly
This means we can avoid false-positives when inheriting multiple Unix domain sockets.
2016-03-05daemon: document optional Net::Server dependency
Non-socket activation users will want to install Net::Server for daemonization, pid file writing, and user/group switching.
2016-03-05doc: add contact/see-also/copyright sections to mda manpage
We need manpages before we can expect people to install this.
2016-03-05httpd: remove unnecessary eval
We have per-middleware evals to deal with them being missing; no need to put an eval around the whole thing and use an extra level of indentation.
2016-03-05t/httpd-corner: avoid clobbering existing FDs after fork
Due to the deterministic way reference counting works, we do not want to drop references to existing FDs even if we no longer need the glob reference; the actual FD is all we can pass through on exec.
2016-03-05doc: language-neutral client-side endpoints
Be less specific, client-side code can be written in any language (and I do not care for JS runtimes implemented in C++ :P).
2016-03-05doc: varyus speling fickses
Letz trie 2 uphear liter8
2016-03-05feed: remove unnecessary encoding lookup
We handle encoding-related things elsewhere.
2016-03-05daemon: simplify parent death handling
No need to create a new sub which kill ourselves $$ when we can invoke worker_quit directly.
2016-03-05daemon: avoid cyclic references for once-used callbacks
Not that these subs are repeatedly created, but this makes the code easier-to-review and these callbacks are idempotent anyways.
2016-03-05daemon: drop listener sockets ASAP on termination
We do not want to be accepting connections during graceful shutdown because another new process is likely taking over. This also allows us to free up the listener case another (independent) process wants to claim it.
2016-03-05t/httpd-corner: additional callback test
Just to ensure we hit the code path independently of WWW code.
2016-03-05git-http-backend: favor sysread for regular files
We do not need line buffering, here; so favor sysread to bypass extra copies which may be done by normal read.
2016-03-04daemon: simplify socket inheriting, slightly
IO::Handle->new_from_fd has existed since at least 1996, so it should be safe to depend on at this point.
2016-03-04daemon: support listening on Unix domain sockets
Listening on Unix domain sockets can be convenient for running behind reverse proxies, avoiding port conflicts, limiting access, or avoiding the overhead (if any) of TCP over loopback.
2016-03-03daemon: introduce host_with_port for identifying sockets
This allows us to share more code between daemons and avoids having to make additional syscalls for preparing REMOTE_HOST and REMOTE_PORT in the PSGI env in -httpd. This will also make supporting HTTP (and NNTP) over Unix sockets easier in a future commit.
2016-03-03daemon: avoid polluting the main package
We've distilled the daemon code into one public function ("run"), so avoid polluting the main namespace and just have users prefix with the full package name for this rarely-used class.
2016-03-03t/*.t: use identifiable tempdir names
This should make identifiying leftover directories due to SIGKILL-ed tests easier.
2016-03-03view: fix stupid typo in inline_dump
Ugh, this enabled-iff-xapian-is-available code really needs better testing...
2016-03-03use raw header for Message-ID
Message-IDs should not be MIME encoded, but in case they are, use the raw form for compatibility with ssoma and possibly other tools. This prevents a potential problem where a malicious client could confuse our storage layer into indexing incorrect contents.
2016-03-01http: better error handling for EMFILE/ENFILE
Better to throw the error back to the client ASAP if we're out-of-descriptors. We will need to implement idle client expiration for long-lived HTTP connections.
2016-03-01httpd: remove unneeded err and out fields from class
Vestigial pieces from the nntpd code which aren't needed because the psgi env already has the "psgi.errors" key.
2016-03-01httpd: document pi-httpd.async as totally unstable
We'll have to use it some more before deciding it is a public interface. I do hope for it to be a usable public interface one day for other users.
2016-03-01processpipe: preserve native close behavior
We need to ensure close on handles tied to this class get the same errors a normal "close" in Perl gets.
2016-03-01linkify: do not capture trailing '.' or ';' in URLs
It seems common for users to end statements with URLs, while it is rare for a URL itself to end with a '.' or ';'. So make a guess and assume the URL was intended to not include the trailing '.' or ';'
2016-03-01extract linkification code to a separate package
This will allow us to more easily reuse it elsewhere.
2016-03-01MANIFEST: add examples/apache2_perl_old.conf
Ugh, I wonder if we can/should generate this automatically...
2016-03-01view: consolidate whitespace stripping from messages
We now keep intermediate blank lines in messages, since it could be used to denote logical gaps in the message (such as giving readers a chance to opt out of "spoiler" information). However leading blank lines, trailing blank lines, and trailing whitespace have no useful value we can discern; so drop those entirely to prevent clients from eating up vertical whitespace.
2016-03-01view: do not hide patches or signatures
It's often not that much information and may be useful to reduce HTTP requests a reader will want to make.
2016-02-29fixup Plack-related requires
We do not need to load Plack::Request outside of WWW anymore.
2016-02-29t/init.t: avoid spewing directory names in output
This is a step towards having consistent, reproducible test output. (ugh, but each %hash usage screws that up).