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 +4 -4
- data/lib/excon/socket.rb +6 -5
- data/lib/excon/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9c4f675494e789a53749cef112475feef669b69f6622b759c88e49c10fbc04f3
|
|
4
|
+
data.tar.gz: c00d3ba6014aa1f276c40991bb8af637b2eb7c14e6b874756c465732d1c653f6
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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(
|
|
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
|
|
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