From dd6665eea9fc248770b757a4314c3c2b8de7cc86 Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Sat, 1 Apr 2017 19:09:10 +0100 Subject: [PATCH] fixes --- client | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client b/client index 3e3890f..856c674 100755 --- a/client +++ b/client @@ -5,6 +5,8 @@ from hippotat import * import twisted.web import twisted.web.client +import io + client_cs = None def set_client(ci,cs,pw): @@ -127,9 +129,14 @@ def check_outbound(): hh = { 'User-Agent': ['hippotat'], 'Content-Type': ['multipart/form-data; boundary="b"'], 'Content-Length': [str(len(mime))] } + + bytesreader = io.BytesIO(mime) + producer = twisted.web.client.FileBodyProducer(bytesreader) + req = agent.request(b'POST', c.url, - twisted.web.client.Headers(hh)) + twisted.web.client.Headers(hh), + producer) req.addTimeout(c.http_timeout, reactor) req.addCallbacks(req_ok, req_err) outstanding += 1 -- 2.30.2