Skip to content

Commit 4e3232b

Browse files
Merge pull request #19 from VultureProject/dev
Version 1.2
2 parents dfca44e + 8084017 commit 4e3232b

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

darwin/darwinapi.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ def low_level_call(self, **kwargs):
248248
))
249249

250250
if darwin_body is not None:
251-
darwin_header.body_size = len(darwin_body)
251+
darwin_header.body_size = len(darwin_body) + 1 # See l. 270
252252

253253
else:
254254
darwin_header.body_size = 0
@@ -267,6 +267,15 @@ def low_level_call(self, **kwargs):
267267
self.socket.sendall(darwin_header)
268268

269269
if darwin_body is not None:
270+
#
271+
# This '\n' is added to make sure the packets are correctly forwarded to Darwin with all TCP forwarder.
272+
# This addition does not interfere with the json parsing made by Darwin.
273+
#
274+
# Some TCP forwarder are holding on the TCP packet unless the packet contains a newline '\n'.
275+
# This behavior was observed with :
276+
# - HAProxy 2.2.5
277+
#
278+
darwin_body += '\n'
270279
if self.verbose:
271280
print("DarwinApi:: low_level_call:: Sending body \"{darwin_body}\" to Darwin...".format(
272281
darwin_body=darwin_body,

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
setup(
44
name="darwin",
5-
version="1.1",
5+
version="1.2",
66
description="Call Darwin with your Python code!",
77
url="https://github.com/VultureProject/darwin-client-python",
88
author="Guillaume Catto",

0 commit comments

Comments
 (0)