about summary refs log tree commit homepage
path: root/lib/PublicInbox/HTTPD
DateCommit message (Collapse)
2018-02-07update copyrights for 2018
Using update-copyrights from gnulib While we're at it, use the SPDX identifier for AGPL-3.0+ to ease mechanical processing.
2017-01-04httpd/async: remove weaken usage
We do not need to use weaken() here, so avoid it to simplify our interactions with Perl; as weaken requires additional storage and (it seems) time complexity.
2016-12-25httpd/async: improve variable naming
We only refer to PublicInbox::HTTP objects here, so '$io' was a bad name.
2016-07-09httpd/async: reinstate D::S timer usage for cleanup
EvCleanup::asap events are not guaranteed to run after Danga::Socket closes sockets at the event loop. Thus we must use slower Danga::Socket timers which are guaranteed to run at the end of the event loop.
2016-07-09httpd/async: do not attempt future writes on closed sockets
Danga::Socket::close does not clear the write_buf_size field, so it's conceivable we could attempt to queue up data and callbacks we can never flush out.
2016-06-18daemon: be less misleading about graceful shutdown
We do not need to count the httpd.async object against our running client count, that is tied to the socket of the actual client. This prevents misleading sysadmins about connected clients during shutdown.
2016-05-30http: yield body->getline running time
We cannot let a client monopolize the single-threaded server even if it can drain the socket buffer faster than we can emit data. While we're at it, acknowledge the this behavior (which happens naturally) in httpd/async. The same idea is present in NNTP for the long_response code. This is the HTTP followup to: commit 0d0fde0bff97 ("nntp: introduce long response API for streaming") commit 79d8bfedcdd2 ("nntp: avoid signals for long responses")
2016-05-27httpd/async: do not needlessly weaken
The restart_read callback has no chance of circular reference, and weakening $self before we create it can cause $self to be undefined inside the callback (seen during stress testing). Fixes: 395406118cb2 ("httpd/async: prevent circular reference")
2016-05-27httpd/async: prevent circular reference
We must avoid circular references which can cause leaks in long-running processes. This callback is dangerous since it may never be called to properly terminate everything.
2016-05-24standardize timer-related event-loop code
Standardize the code we have in place to avoid creating too many timer objects. We do not need exact timers for things that don't need to be run ASAP, so we can play things fast and loose to avoid wasting power with unnecessary wakeups. We only need two classes of timers: * asap - run this on the next loop tick, after operating on @Danga::Socket::ToClose to close remaining sockets * later - run at some point in the future. It could be as soon as immediately (like "asap"), and as late as 60s into the future. In the future, we support an "emergency" switch to fire "later" timers immediately.
2016-05-23git-http-backend: refactor to support cleanup
We will have clients dropping connections during long clone and fetch operations; so do not retain references holding backend processes once we detect a client has dropped.
2016-05-22http: rework async_pass support
Unfortunately, the original design did not work because middleware can wrap the response body and make `async_pass' invisible to HTTP.pm
2016-05-22http: async getline supports push_back_read
Sometimes we need to read something to ensure it's a successful response.
2016-05-21http: support async_pass for Danga::Socket
This will allow us to minimize buffering after we wait (possibly a long time) for readability. This also greatly reduces the amount of Danga::Socket-specific knowledge we have in our PSGI code, making it easier for others to understand.
2016-04-30http: graceful shutdown for pi-httpd.async callers
git clones may take a long time and it's wrong to drop connections in the middle of a transaction.
2016-04-25split out NNTPD and HTTPD* modules
Hopefully this modularizes things a little and allows us to work on a combined super server to save RAM.