Closed casperisfine closed 6 months ago
Fix: https://github.com/redis-rb/redis-client/issues/190
buff = "blah".b p io.read_nonblock(10, buffer, exception: false) # :wait_readable p buff
The above code when using a regular Ruby IO socket leaves the buffer intact, because it only replaces the content if it actually read something.
However when using a SSLSocket, the buffer is always cleared regardless of whether something was read or not.
SSLSocket
This difference could cause the offset to be corrupted by pointing forward.
NB: not too sure how to regression test this.
Upstream PR: https://github.com/ruby/openssl/pull/739
Fix: https://github.com/redis-rb/redis-client/issues/190
The above code when using a regular Ruby IO socket leaves the buffer intact, because it only replaces the content if it actually read something.
However when using a
SSLSocket
, the buffer is always cleared regardless of whether something was read or not.This difference could cause the offset to be corrupted by pointing forward.
NB: not too sure how to regression test this.