excon 0.47.0 → 0.48.0

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.

checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7a56d2ea4f0e7507a112cfe1d177a8b37ca1adfc
4
- data.tar.gz: b2fdb0ccb8a0d6840359d2dfdef88d5f1abccc37
3
+ metadata.gz: 3f65ecaae53f54ed501b78702355c4519f457a71
4
+ data.tar.gz: 6b442dbb19c7925645c4b99ed3316891e8a9996f
5
5
  SHA512:
6
- metadata.gz: 39ebff95e1801f15936668206a386e0b964f37ced0dd694d674c9d001c3edbf43056f9f29a72294baaa61e7af5ed6fd784e57564bdffb42b0eccb3e7287e6a00
7
- data.tar.gz: 69b4d61df32ffa3a4df7867d3b0fc3f3fd1dd82f264c6c5a4ffaaf9d644a0b401aae1e5f9c79c74f6d08f8a87f2cfc482645c17b7f725d8e88008bc3977ed5d6
6
+ metadata.gz: 121d8f9a2fec2ea187f8986fbff9bf4b7098fae3af6331b5f35feb330bdc34f3324a83fad280125163c96c0bc4bc7365edeb2d5022a41098420f163edd0ad8c2
7
+ data.tar.gz: f187be053a500304f64140c4059c16eb60ff5d8aeb3ed6d9783acfd1015e46d3706572d30304dd9b58121d47eec3f17ed0e375f478660f1b4e3c992bba9f1de9
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- excon (0.47.0)
4
+ excon (0.48.0)
5
5
 
6
6
  GEM
7
7
  remote: http://rubygems.org/
@@ -1,3 +1,8 @@
1
+ 0.48.0 03/07/2016
2
+ =================
3
+
4
+ optimize by writing part of body with headers when it fits in a chunk
5
+
1
6
  0.47.0 02/29/2016
2
7
  =================
3
8
 
@@ -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.47.0'
17
- s.date = '2016-02-29'
16
+ s.version = '0.48.0'
17
+ s.date = '2016-03-07'
18
18
  s.rubyforge_project = 'excon'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
@@ -140,9 +140,9 @@ module Excon
140
140
 
141
141
  # add additional "\r\n" to indicate end of headers
142
142
  request << CR_NL
143
- socket.write(request) # write out request + headers
144
143
 
145
144
  if datum.has_key?(:request_block)
145
+ socket.write(request) # write out request + headers
146
146
  while true # write out body with chunked encoding
147
147
  chunk = datum[:request_block].call
148
148
  if FORCE_ENC
@@ -155,6 +155,8 @@ module Excon
155
155
  break
156
156
  end
157
157
  end
158
+ elsif body.nil?
159
+ socket.write(request) # write out request + headers
158
160
  elsif !body.nil? # write out body
159
161
  if body.respond_to?(:binmode)
160
162
  body.binmode
@@ -162,6 +164,21 @@ module Excon
162
164
  if body.respond_to?(:rewind)
163
165
  body.rewind rescue nil
164
166
  end
167
+
168
+ # if request + headers is less than chunk size, fill with body
169
+ if FORCE_ENC
170
+ request.force_encoding('BINARY')
171
+ end
172
+ chunk = body.read([datum[:chunk_size] - request.length, 0].max)
173
+ if chunk
174
+ if FORCE_ENC
175
+ chunk.force_encoding('BINARY')
176
+ end
177
+ socket.write(request << chunk)
178
+ else
179
+ socket.write(request) # write out request + headers
180
+ end
181
+
165
182
  while chunk = body.read(datum[:chunk_size])
166
183
  socket.write(chunk)
167
184
  end
@@ -1,6 +1,6 @@
1
1
  module Excon
2
2
 
3
- VERSION = '0.47.0'
3
+ VERSION = '0.48.0'
4
4
 
5
5
  CR_NL = "\r\n"
6
6
 
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.47.0
4
+ version: 0.48.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: 2016-02-29 00:00:00.000000000 Z
13
+ date: 2016-03-07 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activesupport