aws-sdk 1.2.3 → 1.2.4

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.
@@ -0,0 +1,93 @@
1
+ # Copyright 2011 Amazon.com, Inc. or its affiliates. All Rights Reserved.
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License"). You
4
+ # may not use this file except in compliance with the License. A copy of
5
+ # the License is located at
6
+ #
7
+ # http://aws.amazon.com/apache2.0/
8
+ #
9
+ # or in the "license" file accompanying this file. This file is
10
+ # distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF
11
+ # ANY KIND, either express or implied. See the License for the specific
12
+ # language governing permissions and limitations under the License.
13
+
14
+ require 'net/http'
15
+ require 'net/https'
16
+ require 'openssl'
17
+
18
+ class Net::HTTP::ConnectionPool
19
+
20
+ # @private
21
+ class Session
22
+
23
+ def initialize http_session, key
24
+ @http_session = http_session
25
+ @key = key
26
+ @created_at = Time.now
27
+ @last_used_at = nil
28
+ end
29
+
30
+ attr_reader :http_session
31
+
32
+ attr_reader :key
33
+
34
+ attr_reader :created_at
35
+
36
+ attr_reader :last_used_at
37
+
38
+ def request *args, &block
39
+ response = http_session.request(*args, &block)
40
+ @last_used_at = Time.now
41
+ response
42
+ end
43
+
44
+ # @return [nil]
45
+ def finish
46
+ begin
47
+ http_session.finish if http_session.started?
48
+ rescue IOError
49
+ end
50
+ nil
51
+ end
52
+
53
+ class << self
54
+
55
+ def for connection, open_timeout
56
+
57
+ http_args = []
58
+ http_args << connection.host
59
+ http_args << connection.port
60
+ if connection.proxy?
61
+ http_args << connection.proxy_address
62
+ http_args << connection.proxy_port
63
+ http_args << connection.proxy_user
64
+ http_args << connection.proxy_password
65
+ end
66
+
67
+ http = Net::HTTP.new(*http_args)
68
+ #http.set_debug_output($stdout)
69
+ http.open_timeout = open_timeout
70
+
71
+ if connection.ssl?
72
+ http.use_ssl = true
73
+ if connection.ssl_verify_peer?
74
+ http.verify_mode = OpenSSL::SSL::VERIFY_PEER
75
+ http.ca_file = connection.ssl_ca_file if connection.ssl_ca_file
76
+ http.ca_path = connection.ssl_ca_path if connection.ssl_ca_path
77
+ else
78
+ http.verify_mode = OpenSSL::SSL::VERIFY_NONE
79
+ end
80
+ else
81
+ http.use_ssl = false
82
+ end
83
+
84
+ http.start
85
+
86
+ Session.new(http, connection.key)
87
+
88
+ end
89
+
90
+ end
91
+
92
+ end
93
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aws-sdk
3
3
  version: !ruby/object:Gem::Version
4
- hash: 25
4
+ hash: 23
5
5
  prerelease:
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
  - Amazon Web Services
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-11-11 00:00:00 -08:00
18
+ date: 2011-12-07 00:00:00 -08:00
19
19
  default_executable:
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
@@ -229,6 +229,7 @@ files:
229
229
  - lib/aws/record/attribute.rb
230
230
  - lib/aws/record/attribute_macros.rb
231
231
  - lib/aws/record/attributes/boolean.rb
232
+ - lib/aws/record/attributes/date.rb
232
233
  - lib/aws/record/attributes/datetime.rb
233
234
  - lib/aws/record/attributes/float.rb
234
235
  - lib/aws/record/attributes/integer.rb
@@ -353,6 +354,9 @@ files:
353
354
  - lib/aws/sts.rb
354
355
  - lib/aws-sdk.rb
355
356
  - lib/aws.rb
357
+ - lib/net/http/connection_pool/connection.rb
358
+ - lib/net/http/connection_pool/session.rb
359
+ - lib/net/http/connection_pool.rb
356
360
  - lib/aws/api_config/EC2-2011-02-28.yml
357
361
  - lib/aws/api_config/ELB-2011-08-15.yml
358
362
  - lib/aws/api_config/IAM-2010-07-15.yml