net-http-persistent 1.8 → 1.8.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 +0 -0
- data/History.txt +6 -0
- data/README.txt +5 -5
- data/lib/net/http/persistent.rb +3 -3
- data/test/test_net_http_persistent.rb +13 -0
- metadata +13 -10
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/History.txt
CHANGED
data/README.txt
CHANGED
@@ -1,12 +1,12 @@
|
|
1
1
|
= net-http-persistent
|
2
2
|
|
3
|
-
* http://seattlerb.
|
3
|
+
* http://docs.seattlerb.org/net-http-persistent
|
4
4
|
* https://github.com/drbrain/net-http-persistent
|
5
5
|
|
6
6
|
== DESCRIPTION:
|
7
7
|
|
8
|
-
Manages persistent connections using Net::HTTP plus a speed fix for 1.8.
|
9
|
-
thread-safe too!
|
8
|
+
Manages persistent connections using Net::HTTP plus a speed fix for Ruby 1.8.
|
9
|
+
It's thread-safe too!
|
10
10
|
|
11
11
|
Using persistent HTTP connections can dramatically increase the speed of HTTP.
|
12
12
|
Creating a new HTTP connection for every request involves an extra TCP
|
@@ -14,14 +14,14 @@ round-trip and causes TCP congestion avoidance negotiation to start over.
|
|
14
14
|
|
15
15
|
Net::HTTP supports persistent connections with some API methods but does not
|
16
16
|
handle reconnection gracefully. net-http-persistent supports reconnection
|
17
|
-
according to RFC 2616.
|
17
|
+
and retry according to RFC 2616.
|
18
18
|
|
19
19
|
== FEATURES/PROBLEMS:
|
20
20
|
|
21
21
|
* Supports SSL
|
22
22
|
* Thread-safe
|
23
23
|
* Pure ruby
|
24
|
-
* Timeout-less speed boost for 1.8 (by Aaron Patterson)
|
24
|
+
* Timeout-less speed boost for Ruby 1.8 (by Aaron Patterson)
|
25
25
|
|
26
26
|
== INSTALL:
|
27
27
|
|
data/lib/net/http/persistent.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require 'net/http'
|
2
|
+
require 'net/https'
|
2
3
|
require 'net/http/faster'
|
3
4
|
require 'uri'
|
4
5
|
require 'cgi' # for escaping
|
@@ -42,7 +43,7 @@ class Net::HTTP::Persistent
|
|
42
43
|
##
|
43
44
|
# The version of Net::HTTP::Persistent use are using
|
44
45
|
|
45
|
-
VERSION = '1.8'
|
46
|
+
VERSION = '1.8.1'
|
46
47
|
|
47
48
|
##
|
48
49
|
# Error class for errors raised by Net::HTTP::Persistent. Various
|
@@ -435,7 +436,7 @@ class Net::HTTP::Persistent
|
|
435
436
|
retry
|
436
437
|
rescue IOError, EOFError, Timeout::Error,
|
437
438
|
Errno::ECONNABORTED, Errno::ECONNRESET, Errno::EPIPE,
|
438
|
-
Errno::EINVAL => e
|
439
|
+
Errno::EINVAL, OpenSSL::SSL::SSLError => e
|
439
440
|
|
440
441
|
if retried or not can_retry? req
|
441
442
|
due_to = "(due to #{e.message} - #{e.class})"
|
@@ -506,7 +507,6 @@ class Net::HTTP::Persistent
|
|
506
507
|
# Enables SSL on +connection+
|
507
508
|
|
508
509
|
def ssl connection
|
509
|
-
require 'net/https'
|
510
510
|
connection.use_ssl = true
|
511
511
|
|
512
512
|
# suppress warning but allow override
|
@@ -473,6 +473,19 @@ class TestNetHttpPersistent < MiniTest::Unit::TestCase
|
|
473
473
|
assert_match %r%connection refused%, e.message
|
474
474
|
end
|
475
475
|
|
476
|
+
def test_ssl_error
|
477
|
+
uri = URI.parse 'https://example.com/path'
|
478
|
+
c = @http.connection_for uri
|
479
|
+
def c.request(*)
|
480
|
+
raise OpenSSL::SSL::SSLError, "SSL3_WRITE_PENDING:bad write retry"
|
481
|
+
end
|
482
|
+
|
483
|
+
e = assert_raises Net::HTTP::Persistent::Error do
|
484
|
+
@http.request uri
|
485
|
+
end
|
486
|
+
assert_match %r%bad write retry%, e.message
|
487
|
+
end
|
488
|
+
|
476
489
|
def test_request
|
477
490
|
@http.headers['user-agent'] = 'test ua'
|
478
491
|
c = connection
|
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:
|
4
|
+
hash: 53
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 8
|
9
|
-
|
9
|
+
- 1
|
10
|
+
version: 1.8.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-
|
39
|
+
date: 2011-08-09 00:00:00 Z
|
39
40
|
dependencies:
|
40
41
|
- !ruby/object:Gem::Dependency
|
41
42
|
name: minitest
|
@@ -69,8 +70,8 @@ dependencies:
|
|
69
70
|
type: :development
|
70
71
|
version_requirements: *id002
|
71
72
|
description: |-
|
72
|
-
Manages persistent connections using Net::HTTP plus a speed fix for 1.8.
|
73
|
-
thread-safe too!
|
73
|
+
Manages persistent connections using Net::HTTP plus a speed fix for Ruby 1.8.
|
74
|
+
It's thread-safe too!
|
74
75
|
|
75
76
|
Using persistent HTTP connections can dramatically increase the speed of HTTP.
|
76
77
|
Creating a new HTTP connection for every request involves an extra TCP
|
@@ -78,7 +79,7 @@ description: |-
|
|
78
79
|
|
79
80
|
Net::HTTP supports persistent connections with some API methods but does not
|
80
81
|
handle reconnection gracefully. net-http-persistent supports reconnection
|
81
|
-
according to RFC 2616.
|
82
|
+
and retry according to RFC 2616.
|
82
83
|
email:
|
83
84
|
- drbrain@segment7.net
|
84
85
|
executables: []
|
@@ -99,9 +100,11 @@ files:
|
|
99
100
|
- lib/net/http/faster.rb
|
100
101
|
- lib/net/http/persistent.rb
|
101
102
|
- test/test_net_http_persistent.rb
|
102
|
-
homepage: http://seattlerb.
|
103
|
+
homepage: http://docs.seattlerb.org/net-http-persistent
|
103
104
|
licenses: []
|
104
105
|
|
106
|
+
metadata: {}
|
107
|
+
|
105
108
|
post_install_message:
|
106
109
|
rdoc_options:
|
107
110
|
- --main
|
@@ -129,9 +132,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
129
132
|
requirements: []
|
130
133
|
|
131
134
|
rubyforge_project: net-http-persistent
|
132
|
-
rubygems_version: 1.8.
|
135
|
+
rubygems_version: 1.8.6
|
133
136
|
signing_key:
|
134
|
-
specification_version:
|
135
|
-
summary: Manages persistent connections using Net::HTTP plus a speed fix for 1.8
|
137
|
+
specification_version: 4
|
138
|
+
summary: Manages persistent connections using Net::HTTP plus a speed fix for Ruby 1.8
|
136
139
|
test_files:
|
137
140
|
- test/test_net_http_persistent.rb
|
metadata.gz.sig
CHANGED
Binary file
|