Skip to content

Commit 4dcc3de

Browse files
committed
Fix length calculation in protocol
The data is read as bytes, to the length in the response needs to be calculated in bytes and not in chars.
1 parent 87632a7 commit 4dcc3de

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

supervisor_stdout.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ def main():
1515
line = sys.stdin.readline() # read header line from stdin
1616
headers = dict([ x.split(':') for x in line.split() ])
1717
data = sys.stdin.read(int(headers['len'])) # read the event payload
18-
write_stdout('RESULT %s\n%s'%(len(data), data)) # transition from READY to ACKNOWLEDGED
18+
write_stdout('RESULT %s\n%s'%(len(data.encode("utf-8")), data)) # transition from READY to ACKNOWLEDGED
1919

2020
def event_handler(event, response):
2121
line, data = response.split('\n', 1)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy