dalli 3.2.9 → 3.2.11

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: 2fe56d2ea432b05cde81f7b4c5e3017fc8e11788526cd3dbecbaede2e11c1659
4
- data.tar.gz: 450380fe328c475a93b32d4b1cca10fef1d33065d13bed32e1126276621c2e54
3
+ metadata.gz: 17d814f4043cf5882166c1519dd436fb4a7d0caef32c86789dd5da3c5e51e52c
4
+ data.tar.gz: 27ba5ff384558a7ab08c7dcb3e6f2cf43af4c04dddc1ce2e5ca4ab1d35b01001
5
5
  SHA512:
6
- metadata.gz: ccdbfa346efdf6a09ab53fbd4e44179b298028e348716780b5356d909270fce2fa5fdf66f00579703ab9e0a15dde4b699faf483b5fadb016cff434b85b99011a
7
- data.tar.gz: 3c312e4303bf6b076b20fa28a73277b3975396af12cbee42e3c1cceaab9fde3cb679422f3301a0c3c06a784f3706c704d1e181207bb107b245db2683d7f0c690
6
+ metadata.gz: 63914cbb89b5a5d517dfd11f72b6bd56b22c9cb0700d9d53a037e12c7d9872150038f5a50b20f959bda47160644a30a433720e99da54ad048b15fee03ddb9baf
7
+ data.tar.gz: 11ede1a2e918d269cd084f171c97e5bad156b96fe0384e366cd531cc68a543bd1061b34ac437a7c2794e27ad6f63a3661e035c01bb4e8172d6753cfbca839fd1
data/CHANGELOG.md CHANGED
@@ -4,6 +4,23 @@ Dalli Changelog
4
4
  Unreleased
5
5
  ==========
6
6
 
7
+ 3.2.11
8
+ ==========
9
+
10
+ - Fix multi-server `get_multi` stopping at an empty value (#1170)
11
+ - The pipelined reply parser took a hit on a zero-length value (`VA 0`) for the terminating `MN`, so that server's remaining keys were silently missing from the result
12
+ - Its value terminator and any replies not yet parsed stayed on the connection and were read as the replies to later commands on it. Those commands could fail with `Dalli::DalliError: Response error`, or a single-key `get` could silently return another key's value
13
+ - An empty value is now returned as `''`, like a single-key `get` and single-server `get_multi`
14
+ - Affects only clients using `protocol: :meta`; the default binary protocol is not affected
15
+ - Thanks to Julian Richard Contreras for this contribution
16
+
17
+ 3.2.10
18
+ ==========
19
+
20
+ - Fix `Rack::Session::Dalli` with connection_pool 3.x, which only accepts keyword arguments (backport of #1051)
21
+ - Add `logger` as a runtime dependency, since it is no longer a default gem as of Ruby 4.0 (backport of #1010, olleolleolle)
22
+ - CI: patch memcached 1.5.22 so it builds on ubuntu-22.04, and run tests there (backport of #1033)
23
+
7
24
  3.2.9
8
25
  ==========
9
26
 
@@ -143,8 +143,10 @@ module Dalli
143
143
  # We have a complete response that has no body.
144
144
  # This is either the response to the terminating
145
145
  # noop or, if the status is not MN, an intermediate
146
- # error response that needs to be discarded.
147
- return [header_len, true, nil, nil, nil] if body_len.zero?
146
+ # error response that needs to be discarded. A hit
147
+ # on an empty value (VA 0) still has a body -- just
148
+ # its terminator -- so it's parsed below as a value.
149
+ return [header_len, true, nil, nil, nil] if no_body?(tokens, body_len)
148
150
 
149
151
  resp_size = header_len + body_len + TERMINATOR.length
150
152
  # The header is in the buffer, but the body is not. As we don't have
@@ -157,6 +159,11 @@ module Dalli
157
159
  full_response_from_buffer(tokens, body, resp_size)
158
160
  end
159
161
 
162
+ # A zero-size reply has no body unless it's a VA (a hit on an empty value)
163
+ def no_body?(tokens, body_len)
164
+ body_len.zero? && tokens.first != VA
165
+ end
166
+
160
167
  def contains_header?(buf)
161
168
  buf.include?(TERMINATOR)
162
169
  end
data/lib/dalli/version.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Dalli
4
- VERSION = '3.2.9'
4
+ VERSION = '3.2.11'
5
5
 
6
6
  MIN_SUPPORTED_MEMCACHED_VERSION = '1.4'
7
7
  end
@@ -139,7 +139,7 @@ module Rack
139
139
  ::Dalli::Client.new(server_configurations, client_options)
140
140
  else
141
141
  ensure_connection_pool_added!
142
- ConnectionPool.new(pool_options) do
142
+ ConnectionPool.new(**pool_options) do
143
143
  ::Dalli::Client.new(server_configurations, client_options.merge(threadsafe: false))
144
144
  end
145
145
  end
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: 3.2.9
4
+ version: 3.2.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter M. Goldstein
@@ -9,7 +9,21 @@ authors:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 1980-01-02 00:00:00.000000000 Z
12
- dependencies: []
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: logger
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: '0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: '0'
13
27
  description: High performance memcached client for Ruby
14
28
  email:
15
29
  - peter.m.goldstein@gmail.com