From 25e5e23d3eca769e221bccd8d93926b134d84f0c Mon Sep 17 00:00:00 2001 From: Jonathan Dahan Date: Wed, 30 Nov 2011 11:48:46 -0500 Subject: [PATCH] Send the most minimal body for connecting in produce.py --- produce.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/produce.py b/produce.py index c145ef3..efdfa57 100755 --- a/produce.py +++ b/produce.py @@ -32,11 +32,8 @@ def produce(hostname, api_key, swarm_id, resource_id, wrap): #Sleep required to allow the swarm server time to respond with header time.sleep(1) - #Send a blank message to open the connection - stripped_msg = '{"message": {"to": ["' + swarm_id + '"], "payload":}}' - size = hex(len(stripped_msg))[2:] + "\r\n" - chunk = stripped_msg + "\r\n" - conn.send(size+chunk) + #Send a blank http body to open the connection + conn.send('2\r\n\n\n\r\n') #Execute further messages if wrap == False: