dalli 5.2.6 → 5.2.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: db76345a60e108cc8a1aa4f39adae0e657b200b4e3f17f7196702776c1ff8bc4
4
- data.tar.gz: eb643908bb2aa3654f2d7c82bcce21fa82159931e162cdf17bd79d9fe40b2ed0
3
+ metadata.gz: 7f2cea6074db3fcade9ffdc5277b26cddb9752ee9a4229536e2a883755d4137e
4
+ data.tar.gz: 0f4294f047e670e18a2c97c0c7187e84449096a5e230faf7956547e634c996e9
5
5
  SHA512:
6
- metadata.gz: e5d227f5b4e7fda6e35907f0d94b74fcd528d0c203ce6a7c5b01ab33e2908fe78147c70df8661eedbc2b82f1024b4c89bb890fc0418745150c379805f87afea2
7
- data.tar.gz: dbb2e3d7bb7b1c852a8c0d8b359f1621d0aa0f3ef32dbe1ca449e384325a929e0db6ba893357195e284c84162ce3ae4a1ce39e9f86b5b1bfde149a3725ae3a45
6
+ metadata.gz: af2703898196c9ea24497f5777061d90b6797acb39faec3fc82b6206d2beb02668420d318bb519728b1f72383e66c05af465592ab0726e3703f5944b93a78c32
7
+ data.tar.gz: a59742b1c0c146cd2b36f0d36d55fc94c4491353d364a1c8a3f216452ba293b801d79fb7c34dc3ffa85bbe3aea0d72f82621f67dad3aada23579a5e50048e312
data/CHANGELOG.md CHANGED
@@ -1,9 +1,14 @@
1
1
  Dalli Changelog
2
2
  =====================
3
3
 
4
- Unreleased
4
+ 5.2.7
5
5
  ==========
6
6
 
7
+ Bug fixes:
8
+
9
+ - `Rack::Session::Dalli`'s 401 for a session deleted mid-request called `Hash#slice` on the session options. A Rails session store puts an `ActionDispatch::Request::Session::Options` there, so the 401 raised `NoMethodError` instead of expiring the cookie (#1291, @seballot)
10
+ - Since 5.2.0, on JRuby with TLS, Dalli could wait `socket_timeout` for part of a reply that had already arrived, because jruby-openssl can hold it where neither `IO.select` nor OpenSSL's `pending` reports it. A `get_multi` could take `socket_timeout` longer than it needed to. Dalli now reads on JRuby until the TLS socket would block (#1293)
11
+
7
12
  5.2.6
8
13
  ==========
9
14
 
data/lib/dalli/socket.rb CHANGED
@@ -110,8 +110,18 @@ module Dalli
110
110
  # OpenSSL can hold decrypted bytes that IO.select won't report as readable.
111
111
  # With OpenSSL's default (no read-ahead) a short read has already used up
112
112
  # the current record, so this is normally 0; it guards read-ahead setups.
113
- def buffered_data?
114
- pending.positive?
113
+ #
114
+ # jruby-openssl can take the next record off the socket during a short
115
+ # read and hold it where neither pending nor IO.select sees it, so on
116
+ # JRuby a read continues until the socket would block.
117
+ if RUBY_ENGINE == 'jruby'
118
+ def buffered_data?
119
+ true
120
+ end
121
+ else
122
+ def buffered_data?
123
+ pending.positive?
124
+ end
115
125
  end
116
126
 
117
127
  unless method_defined?(:wait_readable)
data/lib/dalli/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dalli
4
- VERSION = '5.2.6'
4
+ VERSION = '5.2.7'
5
5
 
6
6
  MIN_SUPPORTED_MEMCACHED_VERSION = '1.6.27'
7
7
  end
@@ -184,9 +184,12 @@ module Rack
184
184
  end
185
185
  end
186
186
 
187
+ # Rails stores an ActionDispatch::Request::Session::Options in the env, not a
188
+ # Hash. It implements [] (and to_hash) but not Hash#slice, so slicing it
189
+ # raised NoMethodError instead of returning this 401.
187
190
  def missing_session_response(env)
188
191
  options = env[Rack::RACK_SESSION_OPTIONS] || @default_options
189
- cookie = Rack::Utils.delete_set_cookie_header(key, options.slice(:path, :domain))
192
+ cookie = Rack::Utils.delete_set_cookie_header(key, { path: options[:path], domain: options[:domain] })
190
193
  [401, { 'content-type' => 'text/plain', 'set-cookie' => cookie }, ['Wrong session ID']]
191
194
  end
192
195
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dalli
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.6
4
+ version: 5.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter M. Goldstein