~mdw
/
hippotat
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5e23498
)
fixes
author
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 1 Apr 2017 18:09:10 +0000
(19:09 +0100)
committer
Ian Jackson
<ijackson@chiark.greenend.org.uk>
Sat, 1 Apr 2017 18:09:10 +0000
(19:09 +0100)
client
patch
|
blob
|
blame
|
history
diff --git
a/client
b/client
index
3e3890f
..
856c674
100755
(executable)
--- a/
client
+++ b/
client
@@
-5,6
+5,8
@@
from hippotat import *
import twisted.web
import twisted.web.client
import twisted.web
import twisted.web.client
+import io
+
client_cs = None
def set_client(ci,cs,pw):
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))] }
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,
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
req.addTimeout(c.http_timeout, reactor)
req.addCallbacks(req_ok, req_err)
outstanding += 1