chiark / gitweb /
tracebacks
[hippotat.git] / client
diff --git a/client b/client
index ce5e8564b06f95276858d0ef426e9e919fdea2f9..c9682bd944e135b4a57f0bdb8c375f5bdf2188fa 100755 (executable)
--- a/client
+++ b/client
@@ -102,16 +102,24 @@ def check_outbound():
                   c.max_batch_up)
     
     crlf = b'\r\n'
+    lf   =   b'\n'
     mime = (b'--b'                                      + crlf +
-            b'Content-Disposition: form-data; name="m"' + crlf +
+            b'Content-Disposition: form-data; name="m"' + crlf + crlf +
             password                                    + crlf +
             str(c.client)             .encode('ascii')  + crlf +
             str(c.target_outstanding) .encode('ascii')  + crlf +
+          ((
             b'--b'                                      + crlf +
-            b'Content-Disposition: form-data; name="d"' + crlf +
-            mime_translate(d)                           + crlf +
+            b'Content-Disposition: form-data; name="d"' + crlf + crlf +
+            mime_translate(d)                           + crlf
+           ) if len(d) else b'')                               +
             b'--b--'                                    + crlf)
 
+    df = open('data.dump.dbg', mode='wb')
+    df.write(mime)
+    df.close()
+    # POST -use -c 'multipart/form-data; boundary="b"' http://localhost:8099/ <data.dump.dbg
+
     log_debug(DBG.HTTP_FULL, 'requesting: ' + str(mime))
 
     hh = { 'User-Agent': ['hippotat'],