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"
|
fmt += "B"
|
||||||
values.append(defines.PAYLOAD_MARKER)
|
values.append(defines.PAYLOAD_MARKER)
|
||||||
|
|
||||||
fmt += str(len(bytes(payload, "utf-8"))) + "s"
|
if isinstance(payload, bytes):
|
||||||
values.append(bytes(payload, "utf-8"))
|
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):
|
# for b in str(payload):
|
||||||
# fmt += "c"
|
# fmt += "c"
|
||||||
# values.append(bytes(b, "utf-8"))
|
# values.append(bytes(b, "utf-8"))
|
||||||
|
|
Loading…
Reference in a new issue