redis-client 0.22.0 → 0.22.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6471d100e48137355f30f150526beba636372c0a8ab89b1d05c9870f156bd01c
4
- data.tar.gz: 6c5a17e18eabfdb54e500a1f8deec09dbe1aba9234214e34f0ade2fea170b669
3
+ metadata.gz: ac943e2497c5e52f402307d0acb4ba73cb25f6946efe66cb398a40a6b378b7e1
4
+ data.tar.gz: '034386c130f23d555834fa788a1ae8409d90dbf35bd0312045e35c715c26899d'
5
5
  SHA512:
6
- metadata.gz: 7b2253e3c62b2cdce341b210ceeebb25f37484161a356c3982d747884870acb040d071471ca50d0abac605a9e759a89d678fbaf19fd1a21cf0b2bfe3c5fd2472
7
- data.tar.gz: 8b44296f79fa5591b5776ca6a236b1d2cbce76f9f56a008ab564d2ae8381b1da66385c74f0fe7c00d244bd418f1f7e564b8c198ade7c43588f45e25caa94581e
6
+ metadata.gz: b83ef90c1f9f5994c7fbcf3fb304f41d977fbb04cdb0c02e08bc6294b064e939fad19b225fb7ac7b5fd95103712c46d690cdeaa724a2e07e6d343d35a483a14c
7
+ data.tar.gz: 0e3f65ac5ecceedc577d87dbf25604b331be6cfc4ac92c6f54633dc1acbc6ae4519ce32df3a4033a2594c5451194abbf0b80d9a6bcdb996169401af1805bb230
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Unreleased
2
2
 
3
+ # 0.22.1
4
+
5
+ - Fix `ProtocolError: Unknown sigil type` errors when using SSL connection. See #190.
6
+
3
7
  # 0.22.0
4
8
 
5
9
  - Made various performance optimizations to the Ruby driver. See #184.
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- redis-client (0.22.0)
4
+ redis-client (0.22.1)
5
5
  connection_pool
6
6
 
7
7
  GEM
@@ -190,7 +190,8 @@ class RedisClient
190
190
 
191
191
  def fill_buffer(strict, size = @chunk_size)
192
192
  remaining = size
193
- start = @offset - @buffer.bytesize
193
+ buffer_size = @buffer.bytesize
194
+ start = @offset - buffer_size
194
195
  empty_buffer = start >= 0
195
196
 
196
197
  loop do
@@ -199,12 +200,27 @@ class RedisClient
199
200
  else
200
201
  @io.read_nonblock([remaining, @chunk_size].max, exception: false)
201
202
  end
203
+
202
204
  case bytes
203
205
  when :wait_readable
206
+ # Ref: https://github.com/redis-rb/redis-client/issues/190
207
+ # SSLSocket always clear the provided buffer, even when it didn't
208
+ # read anything. So we need to reset the offset accordingly.
209
+ if empty_buffer && @buffer.empty?
210
+ @offset -= buffer_size
211
+ end
212
+
204
213
  unless @io.to_io.wait_readable(@read_timeout)
205
214
  raise ReadTimeoutError, "Waited #{@read_timeout} seconds" unless @blocking_reads
206
215
  end
207
216
  when :wait_writable
217
+ # Ref: https://github.com/redis-rb/redis-client/issues/190
218
+ # SSLSocket always clear the provided buffer, even when it didn't
219
+ # read anything. So we need to reset the offset accordingly.
220
+ if empty_buffer && @buffer.empty?
221
+ @offset -= buffer_size
222
+ end
223
+
208
224
  @io.to_io.wait_writable(@write_timeout) or raise(WriteTimeoutError, "Waited #{@write_timeout} seconds")
209
225
  when nil
210
226
  raise EOFError
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  class RedisClient
4
- VERSION = "0.22.0"
4
+ VERSION = "0.22.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.22.0
4
+ version: 0.22.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jean Boussier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-04-12 00:00:00.000000000 Z
11
+ date: 2024-04-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: connection_pool