Date | Commit message (Collapse) |
|
This saves about 100 bytes of iseq overhead based
on my measurements.
|
|
env['HTTPS'] is not documented in rack SPEC, but appears to be
used by Rack::Request since 2010[*]. Also, set rack.url_scheme
as documented by rack SPEC.
[*] - commit 4defbe5d7c07b3ba721ff34a8ff59fde480a4a9f
("Improves performance by lazy loading the session.")
|
|
Apparently, StringIO#binmode has been totally broken in 1.9+ and
I've always hidden this bug with the combination of an explicit
string and magic "encoding: binary" comments :x
ref: https://bugs.ruby-lang.org/issues/11945
|
|
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
|
|
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.
|
|
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
|
|
Rack::TempfileReaper was added in rack 1.6 to cleanup temporary
files. Make Yahns::TmpIO ducktype-compatible and put it into
env['rack.tempfiles'] array so Rack::TempfileReaper may be used to
free up space used by temporary buffer files.
ref: commit 3bdf5481e49d76b4502c51e5bdd93f68bfd1f0b4 in unicorn
|
|
We don't need optimized dispatch methods in cold code, so use
the more space-efficient "nil?" method dispatch to save us one
word per-call site for a rough total of 24 bytes saving.
|
|
Instance variable attr methods are cheaper and we can shove the
complexity down to tmpio by allowing it to accept a nil argument
for the temporary directory.
This adds 4 bytes to tmpio but removes over 1K in http_context
on a 32-bit system.
|
|
We may not be able to support this in a more performant
way just yet. Since this was never documented, we'll remove
the the current knobs for silently setting and ignoring it.
Users should use Unicorn::HttpParser.max_header_len= for now,
instead. We may change Unicorn::HttpParser in the future if enough
people care about making this functionality per-app.
|
|
This speeds up searching during startup and prevents accidentally
misloading different, potentially incompatible versions of yahns
code.
|
|
This allows users to specify alternative temporary directories
in case buffers get too large for one filesystem to handle or
to give priority to some clients on certain ports.
|
|
This saves about 200 bytes of unswappable kernel memory,
so it might matter for systems with many connections
when hijacking.
|
|
8K is the default for nginx, too. This prevents Ruby/malloc from
getting too fragmented with large buffers and being unable to release
memory back to the OS.
While we're at it, update the documentation to reflect we use this
parameter to control read(2) sizes, too.
|
|
This is mostly code imported from Rainbows! (so GPLv2+). This should
implement everything necessary to prevent clients from DoS-ing us with
overly large bodies. The default is 1M (same as Rainbows! and nginx).
Yahns::MaxBody may become part of the public API (as the equivalent is
in Rainbows!), since it makes more sense in the rackup (config.ru) file
(since it's endpoint-specific). However, that's confusing as
Yahns::MaxBody only works when input_buffering is :lazy or false, and
not when it is true (preread).
|
|
Since we are smarter about closing @input, we can just call
.close on it as closing inputs is forbidden in Rack apps,
anyways. This reduces our class count and should make
things easier to follow.
|
|
|