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 +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/redis_client/ruby_connection/buffered_io.rb +17 -1
- data/lib/redis_client/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac943e2497c5e52f402307d0acb4ba73cb25f6946efe66cb398a40a6b378b7e1
|
4
|
+
data.tar.gz: '034386c130f23d555834fa788a1ae8409d90dbf35bd0312045e35c715c26899d'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b83ef90c1f9f5994c7fbcf3fb304f41d977fbb04cdb0c02e08bc6294b064e939fad19b225fb7ac7b5fd95103712c46d690cdeaa724a2e07e6d343d35a483a14c
|
7
|
+
data.tar.gz: 0e3f65ac5ecceedc577d87dbf25604b331be6cfc4ac92c6f54633dc1acbc6ae4519ce32df3a4033a2594c5451194abbf0b80d9a6bcdb996169401af1805bb230
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -190,7 +190,8 @@ class RedisClient
|
|
190
190
|
|
191
191
|
def fill_buffer(strict, size = @chunk_size)
|
192
192
|
remaining = size
|
193
|
-
|
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
|
data/lib/redis_client/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2024-04-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: connection_pool
|