amq-protocol 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +2 -2
- data/lib/amq/protocol/client.rb +1 -1
- data/lib/amq/protocol/version.rb +1 -1
- data/protocol.rb.pytemplate +1 -1
- data/spec/amq/protocol/blank_body_encoding_spec.rb +14 -0
- data/spec/amq/protocol/frame_spec.rb +1 -1
- data/tasks.rb +0 -2
- metadata +5 -4
data/.travis.yml
CHANGED
data/lib/amq/protocol/client.rb
CHANGED
@@ -244,7 +244,7 @@ module AMQ
|
|
244
244
|
end
|
245
245
|
|
246
246
|
def self.encode_body(body, channel, frame_size)
|
247
|
-
return [
|
247
|
+
return [] if body.empty?
|
248
248
|
|
249
249
|
# See https://dev.rabbitmq.com/wiki/Amqp091Errata#section_11
|
250
250
|
limit = frame_size - 8
|
data/lib/amq/protocol/version.rb
CHANGED
data/protocol.rb.pytemplate
CHANGED
@@ -184,7 +184,7 @@ module AMQ
|
|
184
184
|
end
|
185
185
|
|
186
186
|
def self.encode_body(body, channel, frame_size)
|
187
|
-
return [
|
187
|
+
return [] if body.empty?
|
188
188
|
|
189
189
|
# See https://dev.rabbitmq.com/wiki/Amqp091Errata#section_11
|
190
190
|
limit = frame_size - 8
|
@@ -0,0 +1,14 @@
|
|
1
|
+
# encoding: binary
|
2
|
+
|
3
|
+
require File.expand_path('../../../spec_helper', __FILE__)
|
4
|
+
|
5
|
+
|
6
|
+
describe AMQ::Protocol::Method, ".encode_body" do
|
7
|
+
it "encodes 1-byte long payload as exactly 1 body frame" do
|
8
|
+
described_class.encode_body('1', 1, 65536).size.should == 1
|
9
|
+
end
|
10
|
+
|
11
|
+
it "encodes 0-byte long (blank) payload as exactly 0 body frame" do
|
12
|
+
described_class.encode_body('', 1, 65536).size.should == 0
|
13
|
+
end
|
14
|
+
end
|
data/tasks.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: amq-protocol
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 63
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
8
|
+
- 8
|
9
9
|
- 0
|
10
|
-
version: 0.
|
10
|
+
version: 0.8.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jakub Stastny
|
@@ -18,7 +18,7 @@ autorequire:
|
|
18
18
|
bindir: bin
|
19
19
|
cert_chain: []
|
20
20
|
|
21
|
-
date: 2011-07-
|
21
|
+
date: 2011-07-21 00:00:00 +04:00
|
22
22
|
default_executable:
|
23
23
|
dependencies: []
|
24
24
|
|
@@ -60,6 +60,7 @@ files:
|
|
60
60
|
- protocol.rb.pytemplate
|
61
61
|
- spec/amq/hacks_spec.rb
|
62
62
|
- spec/amq/protocol/basic_spec.rb
|
63
|
+
- spec/amq/protocol/blank_body_encoding_spec.rb
|
63
64
|
- spec/amq/protocol/channel_spec.rb
|
64
65
|
- spec/amq/protocol/confirm_spec.rb
|
65
66
|
- spec/amq/protocol/connection_spec.rb
|