summary refs log tree commit
DateCommit message (Collapse)
2017-12-29webrick: remove concurrent-ruby dev dependency webrick-devdep
Using the Queue class in stdlib is sufficient for this test, so there's no need for a new development dependency. And one big reason I like webrick is it's bundled with Ruby and has no 3rd-party C ext dependencies; so having to download and install one is a bummer.
2017-11-06Add test to make sure `Rack::Builder#call` always create a new app
This behavior is there for use cases like the Rack::Reloader. If you need to cache the app it is better to call `to_app` when needed or use `Rack::Builder.app`. Closes #834
2017-11-06Revert "Merge pull request #953 from jackxxu/cache-to-app-in-rack-builder"
This reverts commit 2afc14627c9656004325ae17d028ebe7f7e73c0f, reversing changes made to 51356a65185d6c74f7e588ec468ad64ca3a49bcb.
2017-11-06Merge pull request #953 from jackxxu/cache-to-app-in-rack-builder
Avoid re-calculation in Rack::Builder call method
2017-10-26Merge pull request #1203 from schneems/schneems/frozen_string_literal_utils
Add frozen_string_literal to utils
2017-10-20Merge pull request #1211 from AlessandroMinali/patch-1
Valid Rack::Deflater :if config example
2017-10-18Valid Rack::Deflater :if config example
2017-08-24Add frozen_string_literal to utils
Speeds up methods by not requiring string literals to be allocated on every call.
2017-08-14Merge pull request #1198 from matthewd/concurrent-event
Prefer Event over CountDownLatch
2017-08-14Prefer Event over CountDownLatch
It's slightly nicer to read, and incidentally avoids a missing require.
2017-08-14Merge pull request #1196 from AlexKVal/patch-1
Fix typos
2017-08-10Fix typos
2017-08-10Fix typos
2017-08-10Merge pull request #1187 from yoshuki/multiple-accel-mapping
Add multi mapping support via header
2017-08-10Merge pull request #1191 from esparta/fix_code_block_http_status_code
Fix the code block used to generate the HTTP_STATUS_CODES hash
2017-07-24Merge branch 'fix-jruby'
2017-07-24Merge pull request #1193 from tompng/multipart_less_memory
Reduce memory usage when uploading large file
2017-07-24Fix test of JRuby
2017-07-24Improve documentation about the sync option on deflater
2017-07-24Merge remote-tracking branch 'eric-wong/deflater'
The patch can be found at https://groups.google.com/d/msg/rack-devel/Imtb_19E0WM/DQG74tbOBQAJ.
2017-07-24Merge remote-tracking branch 'eric-wong/logger-time'
Patch can be found in https://groups.google.com/d/msg/rack-devel/QmLRFtKeywQ/EJRXNnrPBQAJ
2017-07-21Merge pull request #1194 from oana-sipos/master
Add Hanami to the list of frameworks that use Rack.
2017-07-21Add Hanami on the list of frameworks that use Rack.
2017-07-21reduce memory in multipar parser
2017-07-19Merge pull request #1192 from jkowens/master
Boost multipart parsing perf by increasing buffer size from 16 KiB to 1 MiB
2017-07-19Increase the parser buffer size
This increases the buffer size to 1mb to get better performance parsing larger files. Buffer sizes of 16kb, 1mb, 10mb, and 100mb were compared based on performance and cpu/memory usage.
2017-07-19Merge pull request #1179 from tompng/master
Large file upload performance fix
2017-07-11Fix the code block used to generate the HTTP_STATUS_CODES hash [skip ci]
2017-07-11Merge pull request #1190 from hugoabonizio/master
Update homepage links to be HTTPS
2017-07-12Merge pull request #1189 from lugray/fix_rack_lock
Stop replacing the environment in Rack::Lock
2017-07-11Update homepage links to be HTTPS
2017-07-10Stop replacing the environment in Rack::Lock
While the flow of environment information is generally downstream only, test frameworks sometimes rely on being able to pull information added to the environment after `.call`.
2017-07-03Add multi mapping support via header
2017-06-29common_logger: rely on monotonic clock logger-time
As with commit 2474e3a779a8d2b6 for Rack::Runtime, Time.now is inaccurate if system time changes, so do not rely on it if a monotonic clock is available.
2017-06-29deflater: reduce live Time objects deflater
Only create a Time object if the Last-Modified header exists, (immediately use the Integer result of Time#to_). Otherwise, we can rely on the default behavior of Zlib::GzipWriter of setting the mtime to the current time. While we're at it, avoid repeating the hash lookup for Last-Modified. This results in an improvement from 11.0k to 11.4k iterations/sec with the following script: require 'benchmark/ips' require 'rack/mock' req = Rack::MockRequest.env_for('', 'HTTP_ACCEPT_ENCODING' => 'gzip') response = [200, {}, []] deflater = Rack::Deflater.new(lambda { |env| response }) Benchmark.ips do |x| x.report('deflater') do s, h, b = deflater.call(req) b.each { |buf| } b.close end end
2017-06-29deflater: additional mtime tests
The next commit will reduce long-lived Time objects. Regardless of whether that commit is acceptable, having extra tests for existing mtime behavior cannot hurt. For testing responses with the Last-Modified header, setting a random date in the past should make failure to preserve mtime in the gzip header more apparent.
2017-06-29deflater: support "sync: false" option
Flushing after after very flush is great for real-time apps. However, flushing is inefficient when apps use Rack::Response to generate many small writes (e.g. Rack::Lobster). Allow users to disable the default "sync: true" behavior to reduce bandwidth usage, otherwise using Rack::Deflater can lead to using more bandwidth than without it.
2017-06-29deflater: avoid wasting an ivar slot on @closed
We can merely set the @body to nil ensure we do not call close on the @body, twice. Saving an ivar slot can save 8 bytes per object at minimum, and this makes me feel more comfortable about using another ivar for the next commit.
2017-06-29deflater: rely on frozen_string_literal
This improves readability of our code and can allow us to generate less garbage in Ruby 2.3+ for places where we didn't already use constants. We can also avoid the old constant lookups (and associated inline cache overhead) this way.
2017-06-28Partially reverting 8a7a142d
Thanks pmc@citylink.dinoex.sub.org for the patch
2017-06-14large file upload performance++
2017-05-30Require the right file for the digest we're using
2017-05-15Merge pull request #1163 from janko-m/rely-on-size-in-mock-request
Rely on input responding to #size instead of #length in MockRequest.env_for
2017-05-15Merge pull request #1166 from jnraine/master
Safely handle modules in `Rack::Session::Abstract::ID` subclass ancestor list
2017-05-12Safely handle modules in hierarchy
Adds a check before calling `superclass` on an ancestor of a subclass of `Rack::ID` to avoid calling `superclass` on `Module`, which does not implement it. Here is an code example that causes exercises this special case: ```ruby ID = Class.new IDChild = Class.new(ID) MyMod = Module.new Foo = Class.new(IDChild) Foo.include(MyMod) Foo.ancestors.find { |kl| kl.superclass == ID } # NoMethodError: undefined method `superclass' for MyMod:Module Foo.ancestors.find { |kl| kl.respond_to?(:superclass) && kl.superclass == ID } # => IDChild ```
2017-05-12Ensure env values are ASCII 8BIT encoded
When web servers read data from the socket it's encoded as ASCII_8BIT because we don't know the encoding. This change makes the env closer to what a real web server will return in production.
2017-05-08Stop splatting clean array
File.join supports an array parameter so we don't need to expand the array to be mulitple parameters for File.join.
2017-05-08Revert "updating author / email"
This reverts commit 7ca86b7c42def1865f032c4d71c01ea94584b470.
2017-05-01Don't require input to respond to #size in MockRequest.env_for
The #size method isn't part of the Rack input specification, so technically the given Rack input object doesn't have to respond to \#size. This allows us to test our Rack applications with Rack input that doesn't respond to #size, verifying that we're not relying on it.
2017-05-01Rely on input #size instead of #length in MockRequest.env_for
StringIO is the only IO object that responds to #length, the Ruby IO interface actually uses #size. Furthermore #size is actually implemented on IO-like inputs on web servers like Unicorn and Passenger (TeeInput). This change allows using (Temp)file objects as the Rack input.