http_streaming_client 0.8.10 → 0.8.11
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.
- checksums.yaml +4 -4
- data/CHANGELOG +8 -0
- data/lib/http_streaming_client/client.rb +1 -1
- data/lib/http_streaming_client/decoders/gzip.rb +6 -2
- data/lib/http_streaming_client/errors.rb +6 -4
- data/lib/http_streaming_client/version.rb +1 -1
- data/tools/adobe_firehose.rb +1 -1
- data/tools/adobe_firehose_performance_test.rb +1 -1
- 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: bad5818f3b5c3df8b92149668be7618937a5ab38
|
4
|
+
data.tar.gz: bd4781fb0f3a4d79469ebaa4687db83bf795eb31
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9991fdf019ed5302bff0d160140034eb728eca8c0ddbae6855d47e742edfe67b4b1c46c51aeaa41804c043bdda0692f4c48a0d7c72d40ffb7db131c725113afd
|
7
|
+
data.tar.gz: 3862ea3aaa235b50a5d9d2b1928188ca394ebaa260484805bd085ab0e71aed7e3b45115c442972bf3985380c1c6fbab79e689e09334dbfc905d008131d0e17d4
|
data/CHANGELOG
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
http_streaming_client 0.8.11 ()
|
2
|
+
========================================
|
3
|
+
* Fixed warn logging for non-200 HTTP response codes
|
4
|
+
|
5
|
+
http_streaming_client 0.8.10 (1.27.2014)
|
6
|
+
========================================
|
7
|
+
* bug fix for chunked transfer encoding response with no compression and no block handler
|
8
|
+
|
1
9
|
http_streaming_client 0.8.9 (1.26.2014)
|
2
10
|
========================================
|
3
11
|
* A few minor logging warn/debug changes
|
@@ -222,7 +222,7 @@ module HttpStreamingClient
|
|
222
222
|
logger.debug "request: #{request}"
|
223
223
|
response = socket.read(content_length)
|
224
224
|
logger.debug "response: #{response}"
|
225
|
-
raise HttpError.new(response_head[:code], "Received HTTP #{response_head[:code]} response", response_head[:headers])
|
225
|
+
raise HttpError.new(response_head[:code], "Received HTTP #{response_head[:code]} response", response_head[:headers], response)
|
226
226
|
end
|
227
227
|
|
228
228
|
if response_head[:headers]["Transfer-Encoding"] == 'chunked'
|
@@ -29,6 +29,8 @@
|
|
29
29
|
|
30
30
|
require 'zlib'
|
31
31
|
|
32
|
+
require "http_streaming_client/errors"
|
33
|
+
|
32
34
|
module HttpStreamingClient
|
33
35
|
|
34
36
|
module Decoders
|
@@ -94,8 +96,8 @@ module HttpStreamingClient
|
|
94
96
|
process_decompressed_packet(decompressed_packet)
|
95
97
|
end
|
96
98
|
|
97
|
-
rescue Zlib::Error
|
98
|
-
raise DecoderError
|
99
|
+
rescue Zlib::Error => e
|
100
|
+
raise HttpStreamingClient::DecoderError.new(e.message)
|
99
101
|
end
|
100
102
|
end
|
101
103
|
|
@@ -136,8 +138,10 @@ module HttpStreamingClient
|
|
136
138
|
|
137
139
|
if length == @packet_stream.size then
|
138
140
|
@packet_stream = ""
|
141
|
+
#@packet_stream = @packet_stream.slice!(0,length)
|
139
142
|
else
|
140
143
|
@packet_stream = @packet_stream[length..-1]
|
144
|
+
#@packet_stream = @packet_stream.slice!(0,length)
|
141
145
|
end
|
142
146
|
|
143
147
|
#logger.debug "GZipBufferIO:readpartial:after:psize:#{@packet_stream.size}:bsize:#{buffer.size}"
|
@@ -29,7 +29,6 @@
|
|
29
29
|
|
30
30
|
module HttpStreamingClient
|
31
31
|
|
32
|
-
|
33
32
|
class InvalidContentType < Exception; end
|
34
33
|
|
35
34
|
class InvalidRedirect < Exception; end
|
@@ -37,16 +36,19 @@ module HttpStreamingClient
|
|
37
36
|
class ReconnectRequest < StandardError; end
|
38
37
|
|
39
38
|
class HttpTimeOut < StandardError; end
|
39
|
+
|
40
|
+
class DecoderError < StandardError; end
|
40
41
|
|
41
42
|
class HttpError < StandardError
|
42
43
|
|
43
|
-
attr_reader :status, :message, :headers
|
44
|
+
attr_reader :status, :message, :headers, :response
|
44
45
|
|
45
|
-
def initialize(status, message, headers = nil)
|
46
|
-
super "#{status}:#{message}"
|
46
|
+
def initialize(status, message, headers = nil, response = nil)
|
47
|
+
super "#{status}:#{message}:#{headers}:#{response}"
|
47
48
|
@status = status
|
48
49
|
@message = message
|
49
50
|
@headers = headers
|
51
|
+
@response = response
|
50
52
|
end
|
51
53
|
end
|
52
54
|
|
data/tools/adobe_firehose.rb
CHANGED
@@ -13,7 +13,7 @@ include HttpStreamingClient::Credentials::Adobe
|
|
13
13
|
url = TOKENAPIHOST
|
14
14
|
authorization = HttpStreamingClient::Oauth::Adobe.generate_authorization(url, USERNAME, PASSWORD, CLIENTID, CLIENTSECRET)
|
15
15
|
puts "#{TOKENAPIHOST}:access token: #{authorization}"
|
16
|
-
client = HttpStreamingClient::Client.new(compression:
|
16
|
+
client = HttpStreamingClient::Client.new(compression: true)
|
17
17
|
response = client.get(STREAMURL, {:headers => {'Authorization' => "Bearer #{authorization}" }}) { |line|
|
18
18
|
|
19
19
|
if line.nil? then
|
@@ -13,7 +13,7 @@ include HttpStreamingClient::Credentials::Adobe
|
|
13
13
|
url = TOKENAPIHOST
|
14
14
|
authorization = HttpStreamingClient::Oauth::Adobe.generate_authorization(url, USERNAME, PASSWORD, CLIENTID, CLIENTSECRET)
|
15
15
|
puts "#{TOKENAPIHOST}:access token: #{authorization}"
|
16
|
-
client = HttpStreamingClient::Client.new(compression:
|
16
|
+
client = HttpStreamingClient::Client.new(compression: true)
|
17
17
|
|
18
18
|
NUM_RECORDS_PER_BATCH = 5000
|
19
19
|
MAX_RECORDS = 3600000
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http_streaming_client
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.11
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Tompkins
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-01-
|
11
|
+
date: 2014-01-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|