File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -248,7 +248,7 @@ def low_level_call(self, **kwargs):
248
248
))
249
249
250
250
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
252
252
253
253
else :
254
254
darwin_header .body_size = 0
@@ -267,6 +267,15 @@ def low_level_call(self, **kwargs):
267
267
self .socket .sendall (darwin_header )
268
268
269
269
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 '
270
279
if self .verbose :
271
280
print ("DarwinApi:: low_level_call:: Sending body \" {darwin_body}\" to Darwin..." .format (
272
281
darwin_body = darwin_body ,
Original file line number Diff line number Diff line change 2
2
3
3
setup (
4
4
name = "darwin" ,
5
- version = "1.1 " ,
5
+ version = "1.2 " ,
6
6
description = "Call Darwin with your Python code!" ,
7
7
url = "https://github.com/VultureProject/darwin-client-python" ,
8
8
author = "Guillaume Catto" ,
You can’t perform that action at this time.
0 commit comments