net-http-persistent 1.5 → 1.5.1

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.
data.tar.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,8 @@
1
+ === 1.5.1 / 2011-02-10
2
+
3
+ * Bug fix
4
+ * Only set TCP_NODELAY at connection start. Reported by Brian Henderson.
5
+
1
6
  === 1.5 / 2011-01-25
2
7
 
3
8
  * Minor Enhancements
@@ -37,7 +37,7 @@ class Net::HTTP::Persistent
37
37
  ##
38
38
  # The version of Net::HTTP::Persistent use are using
39
39
 
40
- VERSION = '1.5'
40
+ VERSION = '1.5.1'
41
41
 
42
42
  ##
43
43
  # Error class for errors raised by Net::HTTP::Persistent. Various
@@ -222,11 +222,11 @@ class Net::HTTP::Persistent
222
222
  connection.read_timeout = @read_timeout if @read_timeout
223
223
 
224
224
  connection.start
225
- end
226
225
 
227
- if Socket.const_defined? :TCP_NODELAY then
228
- socket = connection.instance_variable_get :@socket
229
- socket.io.setsockopt Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1
226
+ if Socket.const_defined? :TCP_NODELAY then
227
+ socket = connection.instance_variable_get :@socket
228
+ socket.io.setsockopt Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1
229
+ end
230
230
  end
231
231
 
232
232
  connection
@@ -167,6 +167,27 @@ class TestNetHttpPersistent < MiniTest::Unit::TestCase
167
167
  assert_same cached, c
168
168
  end
169
169
 
170
+ def test_connection_for_closed
171
+ cached = basic_connection
172
+ cached.start
173
+ if Socket.const_defined? :TCP_NODELAY then
174
+ def (cached.instance_variable_get(:@socket).io).setsockopt(*a)
175
+ raise IOError, 'closed stream'
176
+ end
177
+ end
178
+ conns['example.com:80'] = cached
179
+
180
+ c = @http.connection_for @uri
181
+
182
+ assert c.started?
183
+
184
+ assert_includes conns.keys, 'example.com:80'
185
+ assert_same c, conns['example.com:80']
186
+
187
+ socket = c.instance_variable_get :@socket
188
+ assert_nil socket.io.instance_variable_get(:@setsockopt)
189
+ end
190
+
170
191
  def test_connection_for_debug_output
171
192
  io = StringIO.new
172
193
  @http.debug_output = io
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-http-persistent
3
3
  version: !ruby/object:Gem::Version
4
- hash: 5
5
- prerelease: false
4
+ hash: 1
5
+ prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 5
9
- version: "1.5"
9
+ - 1
10
+ version: 1.5.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Eric Hodel
@@ -35,7 +36,7 @@ cert_chain:
35
36
  x52qPcexcYZR7w==
36
37
  -----END CERTIFICATE-----
37
38
 
38
- date: 2011-01-25 00:00:00 -08:00
39
+ date: 2011-02-10 00:00:00 -08:00
39
40
  default_executable:
40
41
  dependencies:
41
42
  - !ruby/object:Gem::Dependency
@@ -62,12 +63,12 @@ dependencies:
62
63
  requirements:
63
64
  - - ">="
64
65
  - !ruby/object:Gem::Version
65
- hash: 47
66
+ hash: 43
66
67
  segments:
67
68
  - 2
68
- - 8
69
+ - 9
69
70
  - 0
70
- version: 2.8.0
71
+ version: 2.9.0
71
72
  type: :development
72
73
  version_requirements: *id002
73
74
  description: |-
@@ -124,7 +125,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
124
125
  requirements: []
125
126
 
126
127
  rubyforge_project: seattlerb
127
- rubygems_version: 1.3.7
128
+ rubygems_version: 1.5.0
128
129
  signing_key:
129
130
  specification_version: 3
130
131
  summary: Persistent connections using Net::HTTP plus a speed fix for 1.8
metadata.gz.sig CHANGED
Binary file