excon 0.93.1 → 0.95.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/CONTRIBUTORS.md +182 -140
- data/excon.gemspec +0 -1
- data/lib/excon/socket.rb +33 -11
- data/lib/excon/version.rb +1 -1
- metadata +2 -16
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f7bc43cec6bb34b6bc06c7bd894427cbfe40ef6d58ea59b5e2b6b4e66fc7136b
|
|
4
|
+
data.tar.gz: 02b4a808674b90b0f65ef0dca0a860831371765cb093f42793e74a7108245ec0
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ac6e939c6c9a99fa8f36b841f862c99f70f871e911c8180cc5be45d44f175c2fb54320b64bffa64d8b565d71a3997127a5d9aa661373d4b9a61f4f7becb3bc6e
|
|
7
|
+
data.tar.gz: 76d901fe183686d22c3cd727406f4cef1ed29714d75f7338567e4a886a7549255ba3dd45cc1ee9fae9ff2c80a261a17b72f891da7d2473f55c25be8f8c1abe5f
|
data/CONTRIBUTORS.md
CHANGED
|
@@ -1,140 +1,182 @@
|
|
|
1
|
-
* Aaron Stone
|
|
2
|
-
* Adam
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-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
|
111
|
-
*
|
|
112
|
-
*
|
|
113
|
-
*
|
|
114
|
-
*
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
119
|
-
*
|
|
120
|
-
*
|
|
121
|
-
*
|
|
122
|
-
*
|
|
123
|
-
*
|
|
124
|
-
*
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
*
|
|
138
|
-
*
|
|
139
|
-
*
|
|
140
|
-
*
|
|
1
|
+
* Aaron Stone
|
|
2
|
+
* Adam Avilla
|
|
3
|
+
* Adam Esterline
|
|
4
|
+
* Alexander Sandström
|
|
5
|
+
* Alexandr Burov
|
|
6
|
+
* Andrew Katz
|
|
7
|
+
* Andrew Metcalf
|
|
8
|
+
* Andrew Sullivan Cant
|
|
9
|
+
* André Diego Piske
|
|
10
|
+
* Andy Delcambre
|
|
11
|
+
* Anshul Khandelwal
|
|
12
|
+
* Anton Chuchkalov
|
|
13
|
+
* Antonio Terceiro
|
|
14
|
+
* Ash Wilson
|
|
15
|
+
* Atul Bhosale
|
|
16
|
+
* Bart de Water
|
|
17
|
+
* Ben Burkert
|
|
18
|
+
* Benedikt Böhm
|
|
19
|
+
* Bill Mill
|
|
20
|
+
* Bo Jeanes
|
|
21
|
+
* Brandur
|
|
22
|
+
* Brian D. Burns
|
|
23
|
+
* Brian Hartsock
|
|
24
|
+
* Bryan Paxton
|
|
25
|
+
* Caio Chassot
|
|
26
|
+
* Caius Durling
|
|
27
|
+
* Carl Hörberg
|
|
28
|
+
* Carl Hörberg
|
|
29
|
+
* Carlos Sanchez
|
|
30
|
+
* Casper Thomsen
|
|
31
|
+
* Chris Hanks
|
|
32
|
+
* Christoph Rieß
|
|
33
|
+
* Christophe Taton
|
|
34
|
+
* Claudio Poli
|
|
35
|
+
* Craig Shannon
|
|
36
|
+
* Damien Mathieu
|
|
37
|
+
* Dan Hensgen
|
|
38
|
+
* Dan Peterson
|
|
39
|
+
* Dan Prince
|
|
40
|
+
* Dane Harrigan
|
|
41
|
+
* Daniel Berger
|
|
42
|
+
* Dave Myron
|
|
43
|
+
* Dave Newton
|
|
44
|
+
* Dave Vasilevsky
|
|
45
|
+
* David Biehl
|
|
46
|
+
* David Taylor
|
|
47
|
+
* Dimitrij Denissenko
|
|
48
|
+
* Dominik Richter
|
|
49
|
+
* Doug McInnes
|
|
50
|
+
* Esteban Pastorino
|
|
51
|
+
* Eugene Howe
|
|
52
|
+
* Evan Phoenix
|
|
53
|
+
* Fabian Wiesel
|
|
54
|
+
* Federico Ravasio
|
|
55
|
+
* Felix Wolfsteller
|
|
56
|
+
* Glenn Pratt
|
|
57
|
+
* Graeme Nelson
|
|
58
|
+
* Grey Baker
|
|
59
|
+
* Guillaume Balaine
|
|
60
|
+
* Hakan Ensari
|
|
61
|
+
* Hiroshi Hatake
|
|
62
|
+
* Ian Neubert
|
|
63
|
+
* Igor Fedoronchuk
|
|
64
|
+
* Jacob Atzen
|
|
65
|
+
* James Cox
|
|
66
|
+
* James Watling
|
|
67
|
+
* Jean Mertz
|
|
68
|
+
* Jeremy Hinegardner
|
|
69
|
+
* Jesse Kempf
|
|
70
|
+
* Jessica Jiang
|
|
71
|
+
* Joe Rafaniello
|
|
72
|
+
* John Keiser
|
|
73
|
+
* John Leach
|
|
74
|
+
* Jonas Pfenniger
|
|
75
|
+
* Jonathan Dance
|
|
76
|
+
* Jonathan Roes
|
|
77
|
+
* Joshua B. Smith
|
|
78
|
+
* Joshua Gross
|
|
79
|
+
* Joshua Mckinney
|
|
80
|
+
* Joshua Napoli
|
|
81
|
+
* Kelly Mahan
|
|
82
|
+
* Kensuke Nagae
|
|
83
|
+
* Kimmo Lehto
|
|
84
|
+
* Koen Rouwhorst
|
|
85
|
+
* Konstantin Shabanov
|
|
86
|
+
* Kyle Purkiss
|
|
87
|
+
* Kyle Rames
|
|
88
|
+
* Lewis Marshall
|
|
89
|
+
* Lincoln Stoll
|
|
90
|
+
* Louis Sobel
|
|
91
|
+
* Mahemoff
|
|
92
|
+
* Marco Costa
|
|
93
|
+
* Markus Bucher
|
|
94
|
+
* Mathias Meyer
|
|
95
|
+
* Matt Gauger
|
|
96
|
+
* Matt Palmer
|
|
97
|
+
* Matt Sanders
|
|
98
|
+
* Matt Snyder
|
|
99
|
+
* Matt Todd
|
|
100
|
+
* Maurice Schreiber
|
|
101
|
+
* Max Lincoln
|
|
102
|
+
* Michael Brodhead
|
|
103
|
+
* Michael Hale
|
|
104
|
+
* Michael Rowe
|
|
105
|
+
* Michael Rykov
|
|
106
|
+
* Mike Heffner
|
|
107
|
+
* Milovan Zogovic
|
|
108
|
+
* Myron Marston
|
|
109
|
+
* Nathan Long
|
|
110
|
+
* Nathan Sutton
|
|
111
|
+
* Nick Osborn
|
|
112
|
+
* Nicolas Leger
|
|
113
|
+
* Nicolas Sanguinetti
|
|
114
|
+
* Paul Gideon Dann
|
|
115
|
+
* Pavel
|
|
116
|
+
* Pavel Valena
|
|
117
|
+
* Peter Meier
|
|
118
|
+
* Peter Weldon
|
|
119
|
+
* Phil Ross
|
|
120
|
+
* Raul Murciano
|
|
121
|
+
* Richard Godbee
|
|
122
|
+
* Richard Ramsden
|
|
123
|
+
* Rohan Mendon
|
|
124
|
+
* Ruslan Korolev
|
|
125
|
+
* Ruslan Kyrychuk
|
|
126
|
+
* Ryan Bigg
|
|
127
|
+
* Ryan Mohr
|
|
128
|
+
* Ryan Schlesinger
|
|
129
|
+
* Ryoji Yoshioka
|
|
130
|
+
* Sam
|
|
131
|
+
* Sam Lehman
|
|
132
|
+
* Sam Withrow
|
|
133
|
+
* Scott Gonyea
|
|
134
|
+
* Scott Walkinshaw
|
|
135
|
+
* Sean Cribbs
|
|
136
|
+
* Sergio Rubio
|
|
137
|
+
* Shai Rosenfeld
|
|
138
|
+
* Stan Hu
|
|
139
|
+
* Stefan Merettig
|
|
140
|
+
* Stephen Chu
|
|
141
|
+
* Swanand Pagnis
|
|
142
|
+
* Terry Howe
|
|
143
|
+
* Thom Mahoney & Josh Lane
|
|
144
|
+
* Thom May
|
|
145
|
+
* Tim Carey-Smith
|
|
146
|
+
* Timothée Peignier
|
|
147
|
+
* Tobias Schmidt
|
|
148
|
+
* Todd Lunter
|
|
149
|
+
* Tom Maher
|
|
150
|
+
* Trym Skaar
|
|
151
|
+
* Tuomas Silen
|
|
152
|
+
* Victor Costan
|
|
153
|
+
* Viven
|
|
154
|
+
* Vít Ondruch
|
|
155
|
+
* Wesley Beary
|
|
156
|
+
* Yusuke Nakamura
|
|
157
|
+
* Zach Anker
|
|
158
|
+
* chrisrhoden
|
|
159
|
+
* dependabot[bot]
|
|
160
|
+
* dickeyxxx
|
|
161
|
+
* geemus
|
|
162
|
+
* geemus (Wesley Beary)
|
|
163
|
+
* ggoodale
|
|
164
|
+
* ivan.filenko
|
|
165
|
+
* jasquat
|
|
166
|
+
* karimb
|
|
167
|
+
* marios
|
|
168
|
+
* mkb
|
|
169
|
+
* nathannaveen
|
|
170
|
+
* ojab
|
|
171
|
+
* patrick brisbin
|
|
172
|
+
* pavel
|
|
173
|
+
* phiggins
|
|
174
|
+
* rin_ne
|
|
175
|
+
* rinrinne
|
|
176
|
+
* rkyrychuk
|
|
177
|
+
* shale
|
|
178
|
+
* sshaw
|
|
179
|
+
* starbelly
|
|
180
|
+
* twrodriguez
|
|
181
|
+
* wsnarski
|
|
182
|
+
* zimbatm
|
data/excon.gemspec
CHANGED
|
@@ -26,7 +26,6 @@ Gem::Specification.new do |s|
|
|
|
26
26
|
s.add_development_dependency('eventmachine', '>= 1.0.4')
|
|
27
27
|
s.add_development_dependency('open4')
|
|
28
28
|
s.add_development_dependency('rake')
|
|
29
|
-
s.add_development_dependency('rdoc')
|
|
30
29
|
s.add_development_dependency('shindo')
|
|
31
30
|
s.add_development_dependency('sinatra')
|
|
32
31
|
s.add_development_dependency('sinatra-contrib')
|
data/lib/excon/socket.rb
CHANGED
|
@@ -40,12 +40,14 @@ module Excon
|
|
|
40
40
|
|
|
41
41
|
def_delegators(:@socket, :close)
|
|
42
42
|
|
|
43
|
+
|
|
43
44
|
def initialize(data = {})
|
|
44
45
|
@data = data
|
|
45
46
|
@nonblock = data[:nonblock]
|
|
46
47
|
@port ||= @data[:port] || 80
|
|
47
48
|
@read_buffer = String.new
|
|
48
49
|
@eof = false
|
|
50
|
+
@backend_eof = false
|
|
49
51
|
connect
|
|
50
52
|
end
|
|
51
53
|
|
|
@@ -61,9 +63,22 @@ module Excon
|
|
|
61
63
|
|
|
62
64
|
def readline
|
|
63
65
|
if @nonblock && RUBY_VERSION.to_f > 1.8_7
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
66
|
+
result = String.new
|
|
67
|
+
block = @read_buffer
|
|
68
|
+
@read_buffer = String.new
|
|
69
|
+
|
|
70
|
+
loop do
|
|
71
|
+
idx = block.index("\n")
|
|
72
|
+
if idx.nil?
|
|
73
|
+
result << block
|
|
74
|
+
else
|
|
75
|
+
result << block.slice!(0, idx+1)
|
|
76
|
+
add_to_read_buffer(block)
|
|
77
|
+
break
|
|
78
|
+
end
|
|
79
|
+
block = read_nonblock(@data[:chunk_size]) || raise(EOFError)
|
|
80
|
+
end
|
|
81
|
+
result
|
|
67
82
|
else # nonblock/legacy
|
|
68
83
|
begin
|
|
69
84
|
Timeout.timeout(@data[:read_timeout]) do
|
|
@@ -172,20 +187,27 @@ module Excon
|
|
|
172
187
|
end
|
|
173
188
|
end
|
|
174
189
|
|
|
190
|
+
def add_to_read_buffer(str)
|
|
191
|
+
@read_buffer << str
|
|
192
|
+
@eof = false
|
|
193
|
+
end
|
|
194
|
+
|
|
175
195
|
def read_nonblock(max_length)
|
|
176
196
|
begin
|
|
177
197
|
if max_length
|
|
178
|
-
until @read_buffer.length >= max_length
|
|
198
|
+
until @backend_eof || @read_buffer.length >= max_length
|
|
179
199
|
@read_buffer << @socket.read_nonblock(max_length - @read_buffer.length)
|
|
180
200
|
end
|
|
181
201
|
else
|
|
182
|
-
|
|
202
|
+
while !@backend_eof
|
|
183
203
|
@read_buffer << @socket.read_nonblock(@data[:chunk_size])
|
|
184
204
|
end
|
|
185
205
|
end
|
|
186
206
|
rescue OpenSSL::SSL::SSLError => error
|
|
187
207
|
if error.message == 'read would block'
|
|
188
|
-
|
|
208
|
+
if @read_buffer.empty?
|
|
209
|
+
select_with_timeout(@socket, :read) && retry
|
|
210
|
+
end
|
|
189
211
|
else
|
|
190
212
|
raise(error)
|
|
191
213
|
end
|
|
@@ -195,10 +217,10 @@ module Excon
|
|
|
195
217
|
select_with_timeout(@socket, :read) && retry
|
|
196
218
|
end
|
|
197
219
|
rescue EOFError
|
|
198
|
-
@
|
|
220
|
+
@backend_eof = true
|
|
199
221
|
end
|
|
200
222
|
|
|
201
|
-
if max_length
|
|
223
|
+
ret = if max_length
|
|
202
224
|
if @read_buffer.empty?
|
|
203
225
|
nil # EOF met at beginning
|
|
204
226
|
else
|
|
@@ -208,6 +230,8 @@ module Excon
|
|
|
208
230
|
# read until EOFError, so return everything
|
|
209
231
|
@read_buffer.slice!(0, @read_buffer.length)
|
|
210
232
|
end
|
|
233
|
+
@eof = @backend_eof && @read_buffer.empty?
|
|
234
|
+
ret
|
|
211
235
|
end
|
|
212
236
|
|
|
213
237
|
def read_block(max_length)
|
|
@@ -219,9 +243,7 @@ module Excon
|
|
|
219
243
|
raise(error)
|
|
220
244
|
end
|
|
221
245
|
rescue *READ_RETRY_EXCEPTION_CLASSES
|
|
222
|
-
|
|
223
|
-
select_with_timeout(@socket, :read) && retry
|
|
224
|
-
end
|
|
246
|
+
select_with_timeout(@socket, :read) && retry
|
|
225
247
|
rescue EOFError
|
|
226
248
|
@eof = true
|
|
227
249
|
end
|
data/lib/excon/version.rb
CHANGED
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: 0.
|
|
4
|
+
version: 0.95.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- dpiddy (Dan Peterson)
|
|
@@ -10,7 +10,7 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date: 2022-
|
|
13
|
+
date: 2022-12-12 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: rspec
|
|
@@ -96,20 +96,6 @@ dependencies:
|
|
|
96
96
|
- - ">="
|
|
97
97
|
- !ruby/object:Gem::Version
|
|
98
98
|
version: '0'
|
|
99
|
-
- !ruby/object:Gem::Dependency
|
|
100
|
-
name: rdoc
|
|
101
|
-
requirement: !ruby/object:Gem::Requirement
|
|
102
|
-
requirements:
|
|
103
|
-
- - ">="
|
|
104
|
-
- !ruby/object:Gem::Version
|
|
105
|
-
version: '0'
|
|
106
|
-
type: :development
|
|
107
|
-
prerelease: false
|
|
108
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
109
|
-
requirements:
|
|
110
|
-
- - ">="
|
|
111
|
-
- !ruby/object:Gem::Version
|
|
112
|
-
version: '0'
|
|
113
99
|
- !ruby/object:Gem::Dependency
|
|
114
100
|
name: shindo
|
|
115
101
|
requirement: !ruby/object:Gem::Requirement
|