carnivore-http 0.2.6 → 0.2.8
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.md +6 -0
- data/carnivore-http-0.2.6.gem +0 -0
- data/lib/carnivore-http/http_paths.rb +1 -1
- data/lib/carnivore-http/http_source.rb +6 -3
- data/lib/carnivore-http/version.rb +1 -1
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2aeabfa6f6dc0811a7cdeb3249e701a58e9eb899
|
4
|
+
data.tar.gz: 7d01fd0e327f4d9172dd064e556482456a6b1483
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 056b6335c5c9c622f2f159423076e4e974250a504fe30b4e55b563f125954a01235b6e60d12b5d99bb96dfc1e272456396c052076c953861d8acd3c40d6d2fd5
|
7
|
+
data.tar.gz: a7db515e4fe78aca2aa5581edf95b0f9a5895b763b48370b4c9eed700ef3741ebeedb67d26253d8862e3bf41b99a808e46720770ed4b10edbf4864f5862dadd9
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
# v0.2.8
|
2
|
+
* Set confirmed state directly into message
|
3
|
+
* Support body on non-200 type responses
|
4
|
+
* Wait on socket status instead of request status
|
5
|
+
* Always close connection after confirmation
|
6
|
+
|
1
7
|
# v0.2.6
|
2
8
|
* Add support to disable listen
|
3
9
|
* Attempt delivery prior to payload persist
|
Binary file
|
@@ -97,7 +97,7 @@ module Carnivore
|
|
97
97
|
else
|
98
98
|
wait_time = msg_queue[:config].fetch(:response_timeout, DEFAULT_RESPONSE_TIMEOUT).to_f
|
99
99
|
wait_step = msg_queue[:config].fetch(:response_wait_step, DEFAULT_RESPONSE_WAIT_STEP).to_f
|
100
|
-
while(con.
|
100
|
+
while(!con.socket.closed? && wait_time > 0)
|
101
101
|
sleep(wait_step)
|
102
102
|
wait_time -= wait_step
|
103
103
|
end
|
@@ -275,11 +275,14 @@ module Carnivore
|
|
275
275
|
# @param args [Hash]
|
276
276
|
# @option args [Symbol] :code return code
|
277
277
|
def confirm(message, args={})
|
278
|
-
|
278
|
+
unless(message[:message][:confirmed])
|
279
279
|
code = args.delete(:code) || :ok
|
280
280
|
args[:response_body] = 'Thanks' if code == :ok && args.empty?
|
281
|
-
|
282
|
-
message
|
281
|
+
body = args.delete(:response_body)
|
282
|
+
debug "Confirming #{message} with: Code: #{code.inspect} Args: #{args.inspect} Body: #{body}"
|
283
|
+
message[:message][:request].respond(code, *(args.empty? ? [body] : [args, body]))
|
284
|
+
message[:message][:connection].close
|
285
|
+
message[:message][:confirmed] = true
|
283
286
|
else
|
284
287
|
warn "Message was already confimed. Confirmation not sent! (#{message})"
|
285
288
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: carnivore-http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.8
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Chris Roberts
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-07-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: carnivore
|
@@ -77,6 +77,7 @@ files:
|
|
77
77
|
- Gemfile
|
78
78
|
- LICENSE
|
79
79
|
- README.md
|
80
|
+
- carnivore-http-0.2.6.gem
|
80
81
|
- carnivore-http.gemspec
|
81
82
|
- lib/carnivore-http.rb
|
82
83
|
- lib/carnivore-http/http.rb
|
@@ -115,3 +116,4 @@ signing_key:
|
|
115
116
|
specification_version: 4
|
116
117
|
summary: Message processing helper
|
117
118
|
test_files: []
|
119
|
+
has_rdoc:
|