excon 0.7.2 → 0.7.3

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.

@@ -1,3 +1,56 @@
1
+ 0.7.3 09/27/11
2
+ ==============
3
+
4
+ * fix nonblocking read to avoid reading past chunk in chunked encoded
5
+ * rescue read would block from openssl
6
+
7
+ 0.7.2 09/24/11
8
+ ==============
9
+
10
+ * fix buffer drain for socket#write. thanks dpiddy
11
+ * rescue/retry timeout errors for idempotent requests. thanks dpiddy
12
+ * timeouts should raise an excon specific error
13
+
14
+ 0.7.1 09/13/11
15
+ ==============
16
+
17
+ * use nonblocking only when available (skip for 1.8.x SSL)
18
+
19
+ 0.7.0 09/12/11
20
+ ==============
21
+
22
+ * change connects and most read/writes to use nonblocking methods
23
+ * provide connect/read/write timeouts
24
+
25
+ 0.6.6 09/06/11
26
+ ==============
27
+
28
+ * cleanup/refactoring. thanks nextmat
29
+ * default to connection close as request delimiter
30
+
31
+ 0.6.5 07/13/11
32
+ ==============
33
+
34
+ * properly stream responses with proc
35
+ * fix mock with block to match real requests
36
+
37
+ 0.6.4 07/05/11
38
+ ==============
39
+
40
+ * add block support to mocks. thanks dmeiz
41
+ * fixes for stub matching. thanks dmeiz
42
+ * don't do post_connection_check if verify mode is off
43
+ * check excon state for verify mode instead of checking OpenSSL constants
44
+ * use RbConfig to find OS. thanks trym
45
+ * fixes for idempotent/retry. thanks lstoll
46
+
47
+ 0.6.3 05/02/11
48
+ ==============
49
+
50
+ * fixes for header parsing to allow whitespace after :. thanks myronmarston
51
+ * get_header optimization. thanks nextmat
52
+ * rewind body on retry. thanks pweldon
53
+
1
54
  0.6.2 04/11/11
2
55
  ==============
3
56
 
@@ -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.2'
17
- s.date = '2011-09-23'
16
+ s.version = '0.7.3'
17
+ s.date = '2011-09-27'
18
18
  s.rubyforge_project = 'excon'
19
19
 
20
20
  ## Make sure your summary is short. The description may be as long
@@ -1,6 +1,6 @@
1
1
  module Excon
2
2
  unless const_defined?(:VERSION)
3
- VERSION = '0.7.2'
3
+ VERSION = '0.7.3'
4
4
  end
5
5
 
6
6
  unless const_defined?(:CHUNK_SIZE)
@@ -39,7 +39,15 @@ module Excon
39
39
  def read(max_length)
40
40
  begin
41
41
  until @read_buffer.length >= max_length
42
- @read_buffer << @socket.read_nonblock(max_length)
42
+ @read_buffer << @socket.read_nonblock([max_length, max_length - @read_buffer.length].min)
43
+ end
44
+ rescue OpenSSL::SSL::SSLError => error
45
+ if error.message == 'read would block'
46
+ if IO.select([@socket], nil, nil, @connection_params[:read_timeout])
47
+ retry
48
+ else
49
+ raise(Excon::Errors::Timeout.new("read timeout reached"))
50
+ end
43
51
  end
44
52
  rescue Errno::EAGAIN, Errno::EWOULDBLOCK
45
53
  if IO.select([@socket], nil, nil, @connection_params[:read_timeout])
@@ -49,8 +49,8 @@ module Excon
49
49
  @socket.sync_close = true
50
50
 
51
51
  if @proxy
52
- @socket << "CONNECT " << @connection_params[:host] << ":" << @connection_params[:port] << HTTP_1_1
53
- @socket << "Host: " << @connection_params[:host] << ":" << @connection_params[:port] << CR_NL << CR_NL
52
+ @socket << "CONNECT " << @connection_params[:host] << ":" << @connection_params[:port] << Excon::Connection::HTTP_1_1
53
+ @socket << "Host: " << @connection_params[:host] << ":" << @connection_params[:port] << Excon::Connection::CR_NL << Excon::Connection::CR_NL
54
54
 
55
55
  # eat the proxy's connection response
56
56
  while line = @socket.readline.strip
@@ -70,4 +70,4 @@ module Excon
70
70
  end
71
71
 
72
72
  end
73
- end
73
+ end
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: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 2
10
- version: 0.7.2
9
+ - 3
10
+ version: 0.7.3
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-23 00:00:00 Z
18
+ date: 2011-09-27 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: open4