@@ -27,7 +27,7 @@ module SocketMixin
27
27
CRLF = "\r \n " . freeze
28
28
29
29
# Exceptions raised during non-blocking I/O ops that require retrying the op
30
- if RUBY_VERSION >= "1.9.0 "
30
+ if RUBY_VERSION >= "1.9.3 "
31
31
NBIO_READ_EXCEPTIONS = [ IO ::WaitReadable ]
32
32
NBIO_WRITE_EXCEPTIONS = [ IO ::WaitWritable ]
33
33
else
@@ -105,14 +105,14 @@ def _write_to_socket(data)
105
105
begin
106
106
write_nonblock ( data )
107
107
108
- rescue *NBIO_READ_EXCEPTIONS
109
- if IO . select ( [ self ] , nil , nil , @write_timeout )
108
+ rescue *NBIO_WRITE_EXCEPTIONS
109
+ if IO . select ( nil , [ self ] , nil , @write_timeout )
110
110
retry
111
111
else
112
112
raise Redis ::TimeoutError
113
113
end
114
- rescue *NBIO_WRITE_EXCEPTIONS
115
- if IO . select ( nil , [ self ] , nil , @write_timeout )
114
+ rescue *NBIO_READ_EXCEPTIONS
115
+ if IO . select ( [ self ] , nil , nil , @write_timeout )
116
116
retry
117
117
else
118
118
raise Redis ::TimeoutError
@@ -306,7 +306,7 @@ def self.connect(config)
306
306
if config [ :scheme ] == "unix"
307
307
raise ArgumentError , "SSL incompatible with unix sockets" if config [ :ssl ]
308
308
sock = UNIXSocket . connect ( config [ :path ] , config [ :connect_timeout ] )
309
- elsif config [ :ssl ] && RUBY_VERSION < "1.9.0 "
309
+ elsif config [ :ssl ] && RUBY_VERSION < "1.9.3 "
310
310
raise ArgumentError , "This library does not support SSL on Ruby < 1.9"
311
311
elsif config [ :scheme ] == "rediss" || config [ :ssl ]
312
312
sock = SSLSocket . connect ( config [ :host ] , config [ :port ] , config [ :connect_timeout ] , config [ :ssl_params ] )
0 commit comments