raca 0.3.2 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG +6 -0
- data/lib/raca/container.rb +2 -2
- data/lib/raca/http_client.rb +2 -13
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aaa0a7402a954f81c2f50f2baf971bd5fe2393b3
|
4
|
+
data.tar.gz: 5e047547e7fec0af4e9ef1f0874706b3c6a2decb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0dd7c796af6df4919a712d2a41396f18b5801598202493125f65c6299576d3101c6ce826bf523878c61e42ec761152cada2bd802b4bef0ecc356313c0c9921d
|
7
|
+
data.tar.gz: 64c50f121fa1e365242faef9d7688f826562f6fa6b28b8363fd23307dfb44ab57d61eb7a00d92ebb2065a1e2fc3e40e0875b58ea92981398cb8baa9ab2cea3d0
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
v0.3.3 (26th April 2014)
|
2
|
+
* Added a User-Agent header to all requests
|
3
|
+
* Remove automatic retries after a rackspace timeout
|
4
|
+
* Bugfix: correctly upload files > 5Gb
|
5
|
+
* Bugfix: Use the correct ETag header for uploads
|
6
|
+
|
1
7
|
v0.3.2 (23rd April 2014)
|
2
8
|
* Bugfix: correctly handle a 401 response when a stale token is used for
|
3
9
|
a streaming PUT
|
data/lib/raca/container.rb
CHANGED
@@ -232,7 +232,7 @@ module Raca
|
|
232
232
|
if io.respond_to?(:path)
|
233
233
|
headers['Content-Type'] ||= extension_content_type(io.path)
|
234
234
|
end
|
235
|
-
headers['
|
235
|
+
headers['ETag'] = md5_io(io)
|
236
236
|
headers['Content-Type'] ||= "application/octet-stream"
|
237
237
|
if content_type_needs_cors(key)
|
238
238
|
headers['Access-Control-Allow-Origin'] = "*"
|
@@ -255,7 +255,7 @@ module Raca
|
|
255
255
|
end
|
256
256
|
full_path = File.join(container_path, Raca::Util.url_encode(key)) + "?multipart-manifest=put"
|
257
257
|
manifest_body = StringIO.new(JSON.dump(segments))
|
258
|
-
put_upload(full_path, {
|
258
|
+
put_upload(full_path, {}, manifest_body.string.bytesize, manifest_body)
|
259
259
|
end
|
260
260
|
|
261
261
|
def put_upload(full_path, headers, byte_count, io)
|
data/lib/raca/http_client.rb
CHANGED
@@ -10,7 +10,6 @@ module Raca
|
|
10
10
|
# see Raca::Account#http_client
|
11
11
|
#
|
12
12
|
class HttpClient
|
13
|
-
RETRY_PAUSE = 5
|
14
13
|
|
15
14
|
def initialize(account, hostname, opts = {})
|
16
15
|
@account, @hostname = account, hostname.to_s
|
@@ -78,7 +77,6 @@ module Raca
|
|
78
77
|
# perform an HTTP request to rackpsace.
|
79
78
|
#
|
80
79
|
# request is a Net::HTTP request object.
|
81
|
-
# retries is an int that counts up as the request is tried after a timeout.
|
82
80
|
# This can be called with and without a block. Without a block, the response
|
83
81
|
# is returned as you'd expect
|
84
82
|
#
|
@@ -90,21 +88,12 @@ module Raca
|
|
90
88
|
# puts response
|
91
89
|
# end
|
92
90
|
#
|
93
|
-
def cloud_request(request,
|
91
|
+
def cloud_request(request, &block)
|
94
92
|
cloud_http do |http|
|
95
93
|
request['X-Auth-Token'] = @account.auth_token
|
94
|
+
request['User-Agent'] = "raca 0.3.3 (http://rubygems.org/gems/raca)"
|
96
95
|
http.request(request, &block)
|
97
96
|
end
|
98
|
-
rescue Timeout::Error
|
99
|
-
if retries >= 3
|
100
|
-
raise Raca::TimeoutError, "Timeout from Rackspace while trying #{request.class} to #{request.path}"
|
101
|
-
end
|
102
|
-
|
103
|
-
retry_interval = RETRY_PAUSE + (retries.to_i * RETRY_PAUSE) # Retry after 5, 10, 15 and 20 seconds
|
104
|
-
log "Rackspace timed out: retrying after #{retry_interval}s"
|
105
|
-
sleep(retry_interval)
|
106
|
-
|
107
|
-
cloud_request(request, retries + 1, &block)
|
108
97
|
end
|
109
98
|
|
110
99
|
def cloud_http(&block)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: raca
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- James Healy
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-04-
|
11
|
+
date: 2014-04-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|