excon 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of excon might be problematic. Click here for more details.

@@ -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.2.0'
17
- s.date = '2010-07-25'
16
+ s.version = '0.2.1'
17
+ s.date = '2010-09-08'
18
18
  s.rubyforge_project = 'excon'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
@@ -16,7 +16,7 @@ require 'excon/response'
16
16
  module Excon
17
17
 
18
18
  unless const_defined?(:VERSION)
19
- VERSION = '0.2.0'
19
+ VERSION = '0.2.1'
20
20
  end
21
21
 
22
22
  CHUNK_SIZE = 1048576 # 1 megabyte
@@ -26,15 +26,7 @@ module Excon
26
26
  block = lambda { |chunk| response.body << chunk }
27
27
  end
28
28
 
29
- if response.headers['Connection'] == 'close'
30
- block.call(socket.read)
31
- elsif response.headers['Content-Length']
32
- remaining = response.headers['Content-Length'].to_i
33
- while remaining > 0
34
- block.call(socket.read([CHUNK_SIZE, remaining].min))
35
- remaining -= CHUNK_SIZE
36
- end
37
- elsif response.headers['Transfer-Encoding'] == 'chunked'
29
+ if response.headers['Transfer-Encoding'] == 'chunked'
38
30
  while true
39
31
  chunk_size = socket.readline.chop!.to_i(16)
40
32
  chunk = socket.read(chunk_size + 2).chop! # 2 == "/r/n".length
@@ -44,6 +36,14 @@ module Excon
44
36
  break
45
37
  end
46
38
  end
39
+ elsif response.headers['Connection'] == 'close'
40
+ block.call(socket.read)
41
+ elsif response.headers['Content-Length']
42
+ remaining = response.headers['Content-Length'].to_i
43
+ while remaining > 0
44
+ block.call(socket.read([CHUNK_SIZE, remaining].min))
45
+ remaining -= CHUNK_SIZE
46
+ end
47
47
  end
48
48
  end
49
49
 
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 2
8
- - 0
9
- version: 0.2.0
8
+ - 1
9
+ version: 0.2.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - geemus (Wesley Beary)
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-07-25 00:00:00 -07:00
17
+ date: 2010-09-08 00:00:00 -07:00
18
18
  default_executable:
19
19
  dependencies: []
20
20