vertica 0.10.3 → 0.10.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. data/VERSION +1 -1
  2. data/lib/vertica/connection.rb +16 -8
  3. metadata +1 -1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.10.3
1
+ 0.10.4
@@ -72,12 +72,7 @@ class Vertica::Connection
72
72
  def write_message(message)
73
73
  raise ArgumentError, "invalid message: (#{message.inspect})" unless message.respond_to?(:to_bytes)
74
74
  puts "=> #{message.inspect}" if @debug
75
- begin
76
- socket.write_nonblock message.to_bytes
77
- rescue IO::WaitReadable, IO::WaitWritable => wait_error
78
- io_select(wait_error)
79
- retry
80
- end
75
+ write_bytes message.to_bytes
81
76
  rescue SystemCallError, IOError => e
82
77
  close_socket
83
78
  raise Vertica::Error::ConnectionError.new(e.message)
@@ -206,12 +201,25 @@ class Vertica::Connection
206
201
  end
207
202
 
208
203
  def read_bytes(n)
209
- socket.read_nonblock(n)
204
+ bytes = ""
205
+ until bytes.length == n
206
+ begin
207
+ bytes << socket.read_nonblock(n - bytes.length)
208
+ rescue IO::WaitReadable, IO::WaitWritable => wait_error
209
+ io_select(wait_error)
210
+ retry
211
+ end
212
+ end
213
+ bytes
214
+ end
215
+
216
+ def write_bytes(bytes)
217
+ socket.write_nonblock bytes
210
218
  rescue IO::WaitReadable, IO::WaitWritable => wait_error
211
219
  io_select(wait_error)
212
220
  retry
213
221
  end
214
-
222
+
215
223
  def io_select(exception)
216
224
  readers, writers = nil, nil
217
225
  readers = [socket] if exception.is_a?(IO::WaitReadable)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vertica
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.3
4
+ version: 0.10.4
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: