codegen/protocol.rb.pytemplate in amq-protocol-1.2.0 vs codegen/protocol.rb.pytemplate in amq-protocol-1.3.0
- old
+ new
@@ -18,21 +18,22 @@
SSL_PORT = 5671
# caching
EMPTY_STRING = "".freeze
+ PACK_INT8 = 'c'.freeze
PACK_CHAR = 'C'.freeze
PACK_UINT16 = 'n'.freeze
PACK_UINT16_X2 = 'n2'.freeze
PACK_UINT32 = 'N'.freeze
PACK_UINT32_X2 = 'N2'.freeze
PACK_INT64 = 'q'.freeze
PACK_UCHAR_UINT32 = 'CN'.freeze
PACK_CHAR_UINT16_UINT32 = 'cnN'.freeze
PACK_32BIT_FLOAT = 'f'.freeze
- PACK_64BIT_FLOAT = 'd'.freeze
+ PACK_64BIT_FLOAT = 'G'.freeze
# @return [Array] Collection of subclasses of AMQ::Protocol::Class.
def self.classes
@@ -260,11 +261,11 @@
pieces[i] = result
end
# result = [${klass.index}, 0, body_size, flags].pack('n2Qn')
result = [${klass.index}, 0].pack(PACK_UINT16_X2)
- result += AMQ::Hacks.pack_64_big_endian(body_size)
+ result += AMQ::Hacks.pack_uint64_big_endian(body_size)
result += [flags].pack(PACK_UINT16)
result + pieces.join(EMPTY_STRING)
end
# THIS DECODES ONLY FLAGS
@@ -390,10 +391,11 @@
end
properties_payload = Basic.encode_properties(payload.bytesize, properties)
frames << HeaderFrame.new(properties_payload, channel)
% endif
% if "payload" in method.args():
- frames + self.encode_body(payload, channel, frame_size)
+ frames += self.encode_body(payload, channel, frame_size)
+ frames
% endif
% else:
MethodFrame.new(buffer, channel)
% endif
end