excon 1.5.0 → 1.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5fea894ca265007d66dbec2fcd785d793fff59080175f64c268208d225e32a70
4
- data.tar.gz: bdfe0c227062cc7560e5c8ca9ec4b5dabca2365443b50ab378312a38fc3c73d3
3
+ metadata.gz: 9c4f675494e789a53749cef112475feef669b69f6622b759c88e49c10fbc04f3
4
+ data.tar.gz: c00d3ba6014aa1f276c40991bb8af637b2eb7c14e6b874756c465732d1c653f6
5
5
  SHA512:
6
- metadata.gz: 3baf7973f3a75855cebac881fe5ff3bf28da851dc03900151454802cf2b57700dca2c08bf1f532fe43583ac27baa4e9b8fb0f66611bb3209e1a259e38e947a75
7
- data.tar.gz: b087fedfedbfa0655eb2febab2705f2e699376ec6ec4974c42bd0d3dc55a068ccf7251b0b201f6e051c27b01334b2f1bea4d27cd6b1f5b7fea872b1401df40ae
6
+ metadata.gz: 7a5c8d96a33c026c6b7322e04534b4acb6c3af7c120da1bd6c6f04d67c4345e7f961d1fdfa3916e54e1a2a8edfdd2cb8215cc9f72f26e14088c6fe248692089a
7
+ data.tar.gz: b08af8ba1c5c29d67bfb5e722997902b1664fe07f3aace7552104e0e7cd423d6b7f8aa63094073a10ce42365f0efb0cc9584a2b93108c2be7e9a3a134267760f
data/lib/excon/socket.rb CHANGED
@@ -52,7 +52,8 @@ module Excon
52
52
  @data = data
53
53
  @nonblock = data[:nonblock]
54
54
  @port ||= @data[:port] || 80
55
- @read_buffer = String.new
55
+ @read_buffer = String.new(encoding: Encoding::BINARY)
56
+ @read_buffer_scratch = String.new(encoding: Encoding::BINARY)
56
57
  @read_offset = 0
57
58
  @eof = false
58
59
  @backend_eof = false
@@ -239,7 +240,7 @@ module Excon
239
240
  # Avoid allocating a new buffer string when the read buffer is empty
240
241
  @read_buffer = @socket.read_nonblock(max_length, @read_buffer)
241
242
  else
242
- @read_buffer << @socket.read_nonblock(max_length - readable_bytes)
243
+ @read_buffer << @socket.read_nonblock(max_length - readable_bytes, @read_buffer_scratch)
243
244
  end
244
245
  end
245
246
  else
@@ -248,7 +249,7 @@ module Excon
248
249
  # Avoid allocating a new buffer string when the read buffer is empty
249
250
  @read_buffer = @socket.read_nonblock(@data[:chunk_size], @read_buffer)
250
251
  else
251
- @read_buffer << @socket.read_nonblock(@data[:chunk_size])
252
+ @read_buffer << @socket.read_nonblock(@data[:chunk_size], @read_buffer_scratch)
252
253
  end
253
254
  end
254
255
  end
@@ -298,7 +299,7 @@ module Excon
298
299
  rescue OpenSSL::SSL::SSLError => e
299
300
  select_with_timeout(@socket, :read) && retry if e.message == 'read would block'
300
301
 
301
- raise(error)
302
+ raise(e)
302
303
  rescue *READ_RETRY_EXCEPTION_CLASSES
303
304
  select_with_timeout(@socket, :read) && retry
304
305
  rescue EOFError
@@ -322,7 +323,7 @@ module Excon
322
323
  raise error
323
324
  end
324
325
  rescue OpenSSL::SSL::SSLError, *WRITE_RETRY_EXCEPTION_CLASSES => e
325
- raise e if error.is_a?(OpenSSL::SSL::SSLError) && e.message != 'write would block'
326
+ raise e if e.is_a?(OpenSSL::SSL::SSLError) && e.message != 'write would block'
326
327
 
327
328
  select_with_timeout(@socket, :write) && retry
328
329
  end
data/lib/excon/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Excon
4
- VERSION = '1.5.0'
4
+ VERSION = '1.6.0'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: excon
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.0
4
+ version: 1.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - dpiddy (Dan Peterson)