Let the outbound payload be binary
This commit is contained in:
parent
e9a08fa1d9
commit
f81f415da8
1 changed files with 6 additions and 2 deletions
|
@ -219,8 +219,12 @@ class Serializer(object):
|
|||
fmt += "B"
|
||||
values.append(defines.PAYLOAD_MARKER)
|
||||
|
||||
fmt += str(len(bytes(payload, "utf-8"))) + "s"
|
||||
values.append(bytes(payload, "utf-8"))
|
||||
if isinstance(payload, bytes):
|
||||
fmt += str(len(payload)) + "s"
|
||||
values.append(payload)
|
||||
else:
|
||||
fmt += str(len(bytes(payload, "utf-8"))) + "s"
|
||||
values.append(bytes(payload, "utf-8"))
|
||||
# for b in str(payload):
|
||||
# fmt += "c"
|
||||
# values.append(bytes(b, "utf-8"))
|
||||
|
|
Loading…
Reference in a new issue