excon 0.7.3 → 0.7.4

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.

data/changelog.txt CHANGED
@@ -1,3 +1,8 @@
1
+ 0.7.4 09/30/11
2
+ ==============
3
+
4
+ * rescue write would block from openssl
5
+
1
6
  0.7.3 09/27/11
2
7
  ==============
3
8
 
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.3'
17
- s.date = '2011-09-27'
16
+ s.version = '0.7.4'
17
+ s.date = '2011-09-30'
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.3'
3
+ VERSION = '0.7.4'
4
4
  end
5
5
 
6
6
  unless const_defined?(:CHUNK_SIZE)
data/lib/excon/socket.rb CHANGED
@@ -39,7 +39,7 @@ 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, max_length - @read_buffer.length].min)
42
+ @read_buffer << @socket.read_nonblock(max_length - @read_buffer.length)
43
43
  end
44
44
  rescue OpenSSL::SSL::SSLError => error
45
45
  if error.message == 'read would block'
@@ -66,6 +66,14 @@ module Excon
66
66
  max_length = [@write_buffer.length, Excon::CHUNK_SIZE].min
67
67
  written = @socket.write_nonblock(@write_buffer.slice(0, max_length))
68
68
  @write_buffer.slice!(0, written)
69
+ rescue OpenSSL::SSL::SSLError => error
70
+ if error.message == 'write would block'
71
+ if IO.select(nil, [@socket], nil, @connection_params[:write_timeout])
72
+ retry
73
+ else
74
+ raise(Excon::Errors::Timeout.new("write timeout reached"))
75
+ end
76
+ end
69
77
  rescue Errno::EAGAIN, Errno::EWOULDBLOCK
70
78
  if IO.select(nil, [@socket], nil, @connection_params[:write_timeout])
71
79
  retry
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: 5
4
+ hash: 11
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 7
9
- - 3
10
- version: 0.7.3
9
+ - 4
10
+ version: 0.7.4
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-27 00:00:00 Z
18
+ date: 2011-09-30 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: open4