Permalink
Browse files

Merge pull request #20 from buglabs/minimal-connect-body

Send the most minimal body for connecting in produce.py
  • Loading branch information...
2 parents a177314 + 25e5e23 commit 519268ec4f3ae23565713ee218b0522b15a184d2 @barberdt barberdt committed Nov 30, 2011
Showing with 2 additions and 5 deletions.
  1. +2 −5 produce.py
View
@@ -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:

0 comments on commit 519268e

Please sign in to comment.