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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3211fd54e5e026f3be23a2177c02a8c868e643306724f05cc654b5ec5c5fced
4
- data.tar.gz: 6ad596f7c44528b3a6655c5461d86de5161c8a7e55c1fdecc49d0cca88700921
3
+ metadata.gz: f7bc43cec6bb34b6bc06c7bd894427cbfe40ef6d58ea59b5e2b6b4e66fc7136b
4
+ data.tar.gz: 02b4a808674b90b0f65ef0dca0a860831371765cb093f42793e74a7108245ec0
5
5
  SHA512:
6
- metadata.gz: 3813a14810ae26ba1b7331ac3b6b3b8a96de0aa69b476b10bc063cd4f85169ffd44fd3f90182cf62a0795ea8959239fa1c8aa6974b41aec57805cf170b8ee687
7
- data.tar.gz: c4fc25ce76d8c4304ef6f73b44d1a21179ab3b825d3ca2927fff3bc98082416d0acaa9e7dbe310bd9ebefd2513165eb4158c3ca330c11588092ea708e2e35484
6
+ metadata.gz: ac6e939c6c9a99fa8f36b841f862c99f70f871e911c8180cc5be45d44f175c2fb54320b64bffa64d8b565d71a3997127a5d9aa661373d4b9a61f4f7becb3bc6e
7
+ data.tar.gz: 76d901fe183686d22c3cd727406f4cef1ed29714d75f7338567e4a886a7549255ba3dd45cc1ee9fae9ff2c80a261a17b72f891da7d2473f55c25be8f8c1abe5f
data/CONTRIBUTORS.md CHANGED
@@ -1,140 +1,182 @@
1
- * Aaron Stone <aaron@serendipity.cx>
2
- * Adam Esterline <adam@esterlines.com>
3
- * Alexander Sandström <alexander@skovik.com>
4
- * Andrew Katz <andrew.katz@outright.com>
5
- * Andy Delcambre <adelcambre@gmail.com>
6
- * Anshul Khandelwal <anshul@anshulkhandelwal.com>
7
- * Ash Wilson <smashwilson@gmail.com>
8
- * Ben Burkert <ben@benburkert.com>
9
- * Benedikt Böhm <bb@xnull.de>
10
- * Bo Jeanes <me@bjeanes.com>
11
- * Brandur <brandur@mutelight.org>
12
- * Brian D. Burns <iosctr@gmail.com>
13
- * Brian Hartsock <brian.hartsock@gmail.com>
14
- * Bryan Paxton <starbelly@pobox.com>
15
- * Caio Chassot <dev@caiochassot.com>
16
- * Caius Durling <dev@caius.name>
17
- * Carl Hörberg <carl.hoerberg@gmail.com>
18
- * Carl Hörberg <carl.hoerberg@gmail.com>
19
- * Carlos Sanchez <csanchez@maestrodev.com>
20
- * Casper Thomsen <ct@clearhaus.com>
21
- * Chris Hanks <christopher.m.hanks@gmail.com>
22
- * Claudio Poli <masterkain@gmail.com>
23
- * Damien Mathieu <damien@heroku.com>
24
- * Dan Hensgen <dan@methodhead.com>
25
- * Dan Peterson <dpiddy@gmail.com>
26
- * Dan Prince <dprince@redhat.com>
27
- * Dane Harrigan <dane.harrigan@gmail.com>
28
- * Dave Myron <therealdave.myron@gmail.com>
29
- * Dave Newton <davelnewton@gmail.com>
30
- * David Biehl <dbiehl@ncmedical.com>
31
- * David Biehl <lazylodr@gmail.com>
32
- * Dimitrij Denissenko <dimitrij@blacksquaremedia.com>
33
- * Dominik Richter <dominik.richter@gmail.com>
34
- * Doug McInnes <doug@dougmcinnes.com>
35
- * Eugene Howe <eugene@xtreme-computers.net>
36
- * Evan Phoenix <evan@fallingsnow.net>
37
- * Fabian Wiesel <fabian.wiesel@sap.com>
38
- * Federico Ravasio <ravasio.federico@gmail.com>
39
- * Glenn Pratt <glennpratt@gmail.com>
40
- * Graeme Nelson <graeme.nelson@gmail.com>
41
- * Guillaume Balaine <igosuki@gmail.com>
42
- * Hakan Ensari <hakan.ensari@papercavalier.com>
43
- * Ian Neubert <ian@ianneubert.com>
44
- * Jacob Atzen <jacob@incremental.dk>
45
- * James Cox <james@imaj.es>
46
- * James Watling <watling.james@gmail.com>
47
- * Jean Mertz <jean@mertz.fm>
48
- * Jeremy Hinegardner <jeremy@copiousfreetime.org>
49
- * Jesse Kempf <jesse.kempf@opower.com>
50
- * Joe Rafaniello <jrafanie@redhat.com>
51
- * John Keiser <jkeiser@opscode.com>
52
- * John Leach <john@brightbox.co.uk>
53
- * Jonas Pfenniger <jonas@pfenniger.name>
54
- * Jonathan Dance <github@wuputah.com>
55
- * Jonathan Dance <jd@wuputah.com>
56
- * Jonathan Roes <jroes@jroes.net>
57
- * Joshua B. Smith <jbsmith@us.ibm.com>
58
- * Joshua Gross <joshua@surfeasy.com>
59
- * Joshua Mckinney <joshmckin@gmail.com>
60
- * Joshua Napoli <jnapoli@swipely-napoli.home>
61
- * Joshua Napoli <jnapoli@swipely-napoli.local>
62
- * Kelly Mahan <kmahan@kmahan.com>
63
- * Kensuke Nagae <kyanny@gmail.com>
64
- * Konstantin Shabanov <etehtsea@gmail.com>
65
- * Kyle Rames <kyle.rames@rackspace.com>
66
- * Lewis Marshall <lewis@lmars.net>
67
- * Lincoln Stoll <me@lstoll.net>
68
- * Louis Sobel <sobel@mit.edu>
69
- * Mahemoff <michael@mahemoff.com>
70
- * Mathias Meyer <meyer@paperplanes.de>
71
- * Matt Gauger <matt.gauger@gmail.com>
72
- * Matt Sanders <matt@modal.org>
73
- * Matt Sanders <matt@polycot.com>
74
- * Matt Snyder <snyder2112@me.com>
75
- * Matt Todd <chiology@gmail.com>
76
- * Max Lincoln <max@devopsy.com>
77
- * Michael Brodhead <mkb@engineyard.com>
78
- * Michael Hale <mike@hales.ws>
79
- * Michael Rowe <mrowe@mojain.com>
80
- * Michael Rykov <mrykov@gmail.com>
81
- * Mike Heffner <mikeh@fesnel.com>
82
- * Myron Marston <myron.marston@gmail.com>
83
- * Nathan Long <nathan.long@tma1.com>
84
- * Nathan Sutton <nate@zencoder.com>
85
- * Nick Osborn <nick.osborn@digital.cabinet-office.gov.uk>
86
- * Nicolas Sanguinetti <contacto@nicolassanguinetti.info>
87
- * Paul Gideon Dann <pdgiddie@gmail.com>
88
- * Pavel <pavel.evst@gmail.com>
89
- * Peter Meier <peter.meier@immerda.ch>
90
- * Peter Weldon <peter.weldon@null.net>
91
- * Peter Weldon <peter@lautus.net>
92
- * Phil Ross <phil.ross@gmail.com>
93
- * Richard Ramsden <richard@rramsden.ca>
94
- * Ruslan Korolev <rs3@fastmail.com>
95
- * Ruslan Korolev <rs41@gmx.com>
96
- * Ruslan Kyrychuk <ruslan.kyrychuk@gmail.com>
97
- * Ryan Bigg <radarlistener@fastmail.fm>
98
- * Ryan Mohr <ryan.mohr@gmail.com>
99
- * Sam Withrow <sam.withrow@curiousnation.org>
100
- * Scott Gonyea <me@aitrus.org>
101
- * Scott Gonyea <me@sgonyea.com>
102
- * Scott Walkinshaw <scott.walkinshaw@gmail.com>
103
- * Sean Cribbs <seancribbs@gmail.com>
104
- * Sergio Rubio <rubiojr@frameos.org>
105
- * Shai Rosenfeld <shaiguitar@gmail.com>
106
- * Stefan Merettig <stefan-merettig@nuriaproject.org>
107
- * Stephen Chu <github@stephenchu.com>
108
- * Swanand Pagnis <swanandp@users.noreply.github.com>
109
- * Terry Howe <terrylhowe@gmail.com>
110
- * Thom Mahoney & Josh Lane <tmahoney@engineyard.com>
111
- * Thom May <thom@digital-science.com>
112
- * Tim Carey-Smith <tim@spork.in>
113
- * Todd Lunter <tlunter@gmail.com>
114
- * Tom Maher <tmaher@heroku.com>
115
- * Tom Maher <tmaher@tursom.org>
116
- * Trym Skaar <trym@tryms.no>
117
- * Tuomas Silen <tuomas.silen@nodeta.fi>
118
- * Victor Costan <costan@gmail.com>
119
- * Viven <vivien.schilis@gmail.com>
120
- * Wesley Beary <geemus+github@gmail.com>
121
- * Wesley Beary <geemus@engineyard.com>
122
- * Wesley Beary <geemus@gmail.com>
123
- * Wesley Beary <wbeary@engineyard.com>
124
- * Wesley Beary <wesley@heroku.com>
125
- * Zach Anker <zanker@squareup.com>
126
- * chrisrhoden <carhoden@gmail.com>
127
- * dickeyxxx <jeff@dickeyxxx.com>
128
- * geemus (Wesley Beary) <wbeary@engineyard.com>
129
- * geemus <geemus@gmail.com>
130
- * ggoodale <ggoodale@gmail.com>
131
- * marios <marios@redhat.com>
132
- * mkb <mkb@black-ice.org>
133
- * phiggins <pete@peterhiggins.org>
134
- * rin_ne <rinrin.ne@gmail.com>
135
- * rinrinne <rinrin.ne@gmail.com>
136
- * rkyrychuk <ruslan.kyrychuk@gmail.com>
137
- * sshaw <skye.shaw@gmail.com>
138
- * starbelly <starbelly@pobox.com>
139
- * twrodriguez <tw.rodriguez@gmail.com>
140
- * zimbatm <zimbatm@zimbatm.com>
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
- buffer = String.new
65
- buffer << (read_nonblock(1) || raise(EOFError)) while buffer[-1] != "\n"
66
- buffer
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
- loop do
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
- select_with_timeout(@socket, :read) && retry
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
- @eof = true
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
- if @read_buffer.empty?
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
@@ -1,4 +1,4 @@
1
1
  # frozen_string_literal: true
2
2
  module Excon
3
- VERSION = '0.93.1'
3
+ VERSION = '0.95.0'
4
4
  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: 0.93.1
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-10-20 00:00:00.000000000 Z
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