excon 0.5.1 → 0.5.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 +1 -1
- data/lib/excon.rb +1 -1
- data/lib/excon/response.rb +5 -7
- metadata +3 -3
data/excon.gemspec
CHANGED
@@ -13,7 +13,7 @@ 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.5.
|
16
|
+
s.version = '0.5.2'
|
17
17
|
s.date = '2011-02-11'
|
18
18
|
s.rubyforge_project = 'excon'
|
19
19
|
|
data/lib/excon.rb
CHANGED
data/lib/excon/response.rb
CHANGED
@@ -32,11 +32,10 @@ module Excon
|
|
32
32
|
|
33
33
|
if block_given
|
34
34
|
if response.headers.has_key?('Transfer-Encoding') && response.headers['Transfer-Encoding'].casecmp('chunked') == 0
|
35
|
-
while
|
36
|
-
chunk_size
|
37
|
-
break if chunk_size < 1
|
38
|
-
yield socket.read(chunk_size+2).chop! # 2 == "/r/n".length
|
35
|
+
while (chunk_size = socket.readline.chop!.to_i(16)) > 0
|
36
|
+
yield socket.read(chunk_size + 2).chop! # 2 == "/r/n".length
|
39
37
|
end
|
38
|
+
socket.read(2) # 2 == "/r/n".length
|
40
39
|
elsif response.headers.has_key?('Connection') && response.headers['Connection'].casecmp('close') == 0
|
41
40
|
yield socket.read
|
42
41
|
elsif response.headers.has_key?('Content-Length')
|
@@ -48,11 +47,10 @@ module Excon
|
|
48
47
|
end
|
49
48
|
else
|
50
49
|
if response.headers.has_key?('Transfer-Encoding') && response.headers['Transfer-Encoding'].casecmp('chunked') == 0
|
51
|
-
while
|
52
|
-
chunk_size = socket.readline.chop!.to_i(16)
|
53
|
-
break if chunk_size < 1
|
50
|
+
while (chunk_size = socket.readline.chop!.to_i(16)) > 0
|
54
51
|
response.body << socket.read(chunk_size + 2).chop! # 2 == "/r/n".length
|
55
52
|
end
|
53
|
+
socket.read(2) # 2 == "/r/n".length
|
56
54
|
elsif response.headers.has_key?('Connection') && response.headers['Connection'].casecmp('close') == 0
|
57
55
|
response.body << socket.read
|
58
56
|
elsif response.headers.has_key?('Content-Length')
|
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: 15
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 2
|
10
|
+
version: 0.5.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- geemus (Wesley Beary)
|