net-http-persistent 1.2.3 → 1.2.4

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ === 1.2.4 / 2010-07-26
2
+
3
+ * Bug Fixes
4
+ * Actually have #request only finish a connection. Somehow this got
5
+ missed.
6
+
1
7
  === 1.2.3 / 2010-06-29
2
8
 
3
9
  * Bug Fixes
@@ -36,7 +36,7 @@ class Net::HTTP::Persistent
36
36
  ##
37
37
  # The version of Net::HTTP::Persistent use are using
38
38
 
39
- VERSION = '1.2.3'
39
+ VERSION = '1.2.4'
40
40
 
41
41
  ##
42
42
  # Error class for errors raised by Net::HTTP::Persistent. Various
@@ -344,7 +344,7 @@ class Net::HTTP::Persistent
344
344
  rescue Net::HTTPBadResponse => e
345
345
  message = error_message connection
346
346
 
347
- reset connection
347
+ finish connection
348
348
 
349
349
  raise Error, "too many bad responses #{message}" if
350
350
  bad_response or not idempotent? req
@@ -356,7 +356,7 @@ class Net::HTTP::Persistent
356
356
  due_to = "(due to #{e.message} - #{e.class})"
357
357
  message = error_message connection
358
358
 
359
- reset connection
359
+ finish connection
360
360
 
361
361
  raise Error, "too many connection resets #{due_to} #{message}" if
362
362
  retried or not idempotent? req
@@ -369,6 +369,22 @@ class TestNetHttpPersistent < MiniTest::Unit::TestCase
369
369
  assert_match %r%too many bad responses%, e.message
370
370
  end
371
371
 
372
+ def test_request_reset_retry
373
+ c = connection
374
+ def c.request(*a)
375
+ def self.request(*a)
376
+ :response
377
+ end
378
+
379
+ raise Net::HTTPBadResponse
380
+ end
381
+
382
+ res = @http.request @uri
383
+
384
+ assert_equal :response, res
385
+ assert c.finished?
386
+ end
387
+
372
388
  def test_request_bad_response_unsafe
373
389
  c = connection
374
390
  def c.request(*a)
@@ -423,6 +439,22 @@ class TestNetHttpPersistent < MiniTest::Unit::TestCase
423
439
  assert_match %r%too many connection resets%, e.message
424
440
  end
425
441
 
442
+ def test_request_reset_retry
443
+ c = connection
444
+ def c.request(*a)
445
+ def self.request(*a)
446
+ :response
447
+ end
448
+
449
+ raise Errno::ECONNRESET
450
+ end
451
+
452
+ res = @http.request @uri
453
+
454
+ assert_equal :response, res
455
+ assert c.finished?
456
+ end
457
+
426
458
  def test_request_reset_unsafe
427
459
  c = connection
428
460
  def c.request(*a)
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: net-http-persistent
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease: false
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 3
10
- version: 1.2.3
9
+ - 4
10
+ version: 1.2.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Eric Hodel
@@ -36,7 +36,7 @@ cert_chain:
36
36
  x52qPcexcYZR7w==
37
37
  -----END CERTIFICATE-----
38
38
 
39
- date: 2010-06-29 00:00:00 -07:00
39
+ date: 2010-07-26 00:00:00 -07:00
40
40
  default_executable:
41
41
  dependencies:
42
42
  - !ruby/object:Gem::Dependency
metadata.gz.sig CHANGED
Binary file