excon 0.7.1 → 0.7.2
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.
Potentially problematic release.
This version of excon might be problematic. Click here for more details.
- data/excon.gemspec +2 -2
- data/lib/excon/connection.rb +1 -1
- data/lib/excon/constants.rb +1 -1
- data/lib/excon/errors.rb +2 -0
- data/lib/excon/socket.rb +5 -4
- data/tests/rackups/basic.ru +4 -0
- data/tests/rackups/ssl.ru +4 -0
- data/tests/test_helper.rb +11 -0
- metadata +4 -4
data/excon.gemspec
CHANGED
@@ -13,8 +13,8 @@ Gem::Specification.new do |s|
|
|
13
13
|
## If your rubyforge_project name is different, then edit it and comment out
|
14
14
|
## the sub! line in the Rakefile
|
15
15
|
s.name = 'excon'
|
16
|
-
s.version = '0.7.
|
17
|
-
s.date = '2011-09-
|
16
|
+
s.version = '0.7.2'
|
17
|
+
s.date = '2011-09-23'
|
18
18
|
s.rubyforge_project = 'excon'
|
19
19
|
|
20
20
|
## Make sure your summary is short. The description may be as long
|
data/lib/excon/connection.rb
CHANGED
data/lib/excon/constants.rb
CHANGED
data/lib/excon/errors.rb
CHANGED
data/lib/excon/socket.rb
CHANGED
@@ -45,7 +45,7 @@ module Excon
|
|
45
45
|
if IO.select([@socket], nil, nil, @connection_params[:read_timeout])
|
46
46
|
retry
|
47
47
|
else
|
48
|
-
raise(Timeout
|
48
|
+
raise(Excon::Errors::Timeout.new("read timeout reached"))
|
49
49
|
end
|
50
50
|
end
|
51
51
|
@read_buffer.slice!(0, max_length)
|
@@ -56,12 +56,13 @@ module Excon
|
|
56
56
|
until @write_buffer.empty?
|
57
57
|
begin
|
58
58
|
max_length = [@write_buffer.length, Excon::CHUNK_SIZE].min
|
59
|
-
@socket.write_nonblock(@write_buffer.slice
|
59
|
+
written = @socket.write_nonblock(@write_buffer.slice(0, max_length))
|
60
|
+
@write_buffer.slice!(0, written)
|
60
61
|
rescue Errno::EAGAIN, Errno::EWOULDBLOCK
|
61
|
-
if IO.select(nil [@socket], nil, @connection_params[:write_timeout])
|
62
|
+
if IO.select(nil, [@socket], nil, @connection_params[:write_timeout])
|
62
63
|
retry
|
63
64
|
else
|
64
|
-
raise(Timeout
|
65
|
+
raise(Excon::Errors::Timeout.new("write timeout reached"))
|
65
66
|
end
|
66
67
|
end
|
67
68
|
end
|
data/tests/rackups/basic.ru
CHANGED
data/tests/rackups/ssl.ru
CHANGED
data/tests/test_helper.rb
CHANGED
@@ -48,6 +48,17 @@ def basic_tests(url = 'http://127.0.0.1:9292')
|
|
48
48
|
end
|
49
49
|
data
|
50
50
|
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
54
|
+
tests('POST /body-sink') do
|
55
|
+
|
56
|
+
connection = Excon.new(url)
|
57
|
+
response = connection.request(:method => :post, :path => '/body-sink', :body => 'x' * 5_000_000)
|
58
|
+
|
59
|
+
tests('response.body').returns("5000000") do
|
60
|
+
response.body
|
61
|
+
end
|
51
62
|
end
|
52
63
|
end
|
53
64
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: excon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 2
|
10
|
+
version: 0.7.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- geemus (Wesley Beary)
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-09-
|
18
|
+
date: 2011-09-23 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: open4
|