about summary refs log tree commit homepage
path: root/lib/yahns/socket_helper.rb
DateCommit message (Collapse)
2018-12-08remove IO#close_on_exec= calls
Since we've required Ruby 2.0+ for a while, we can assume descriptors are created with IO#close_on_exec=true and avoid bloating our code with calls to it.
2016-01-02copyright updates for 2016
Using the 'update-copyright' script from gnulib[1]: git ls-files | UPDATE_COPYRIGHT_HOLDER='all contributors' \ UPDATE_COPYRIGHT_USE_INTERVALS=2 \ xargs /path/to/gnulib/build-aux/update-copyright We're also switching to 'GPL-3.0+' as recommended by SPDX to be consistent with our gemspec and other metadata (as opposed to the longer but equivalent "GPLv3 or later"). [1] git://git.savannah.gnu.org/gnulib.git
2016-01-02enable frozen_string_literal for Ruby 2.3+
There are likely yet-to-be-discovered bugs in here. Also, keeping explicit #freeze calls for 2.2 users, since most users have not migrated to 2.3, yet.
2015-10-13copyright updates
Future updates may use the update-copyright script in gnulib: git ls-files | UPDATE_COPYRIGHT_HOLDER='all contributors' \ UPDATE_COPYRIGHT_USE_INTERVALS=2 \ xargs /path/to/gnulib/build-aux/update-copyright
2015-04-07use String#include? for cold, simple substring matches
Literal regexps costs over 400 bytes of memory on x86-64 per-site, so there's no point in using them to cause bloat at cold call sites where runtime performance does not matter.
2014-12-02initial cut at OpenSSL support
The current CA model and code quality of OpenSSL have long put me off from supporting TLS; however but efforts such as "Let's Encrypt" and the fallout from Heartbleed give me hope for the future. This implements, as much as possible, a "hands-off" approach to TLS support via OpenSSL. This implementation allows us to shift responsibility away from us to users and upstreams (the Ruby 'openssl' extension maintainers, software packagers, and OpenSSL project itself). This is also perhaps the easiest way for now for us, while being most powerful for users. It requires users to configure their own OpenSSL context object which we'll use as-is. This context object is used as the :ssl_ctx parameter to the "listen" directive in the yahns configuration file: require 'openssl' # we will not do this for the user, even ctx = OpenSSL::SSL::SSLContext.new # user must configure ctx here... listen 443, ssl_ctx: ctx This way, in case we support GnuTLS or other TLS libraries, there'll be less confusion as to what a user is actually using. Note: this feature requires Ruby 2.1 and later for non-kgio {read,write}_nonblock(.. exception: false) support.
2014-02-04socket_helper: remove SO_REUSEPORT define for untested arches
We'll let systems with updated glibc headers define those (or interested users, if any, on those architectures test and report back to us). No point in causing unnecessary breakage if we screw things up.
2013-10-30socket_helper: account for undefined options
Not all servers may have options set, and we still need to set the default backlog.
2013-10-26support SO_REUSEPORT on new listeners (:reuseport)
This allows users to start an independent instance of unicorn on a the same port as a running unicorn (as long as both instances use :reuseport). ref: https://lwn.net/Articles/542629/
2013-10-26server: avoid metaclass for acceptors
This should make things a little easier-to-follow and possibly improve method cache hit rates for servers with multiple acceptors.
2013-10-21socket_helper: do not log sizes on rbx for now
This needs to be fixed on Rubinius.
2013-10-20set close-on-exec on all long-lived descriptors
This means ruby 1.9.3 should be supported, as well as Ruby implementations which do not set the close-on-exec flag by default. Note: this is only best-effort outside of modern Linux with threads, since a multithreaded process may create and inadvertantly share descriptors. This is why Linux supports O_CLOEXEC, SOCK_CLOEXEC and friends, as kernel support is the only way to sanely fix this.
2013-10-18initial commit