chiark / gitweb /
fixes
[hippotat.git] / client
diff --git a/client b/client
index ce5e856..436592e 100755 (executable)
--- a/client
+++ b/client
@@ -102,16 +102,23 @@ def check_outbound():
                   c.max_batch_up)
     
     crlf = b'\r\n'
                   c.max_batch_up)
     
     crlf = b'\r\n'
+    lf   =   b'\n'
     mime = (b'--b'                                      + crlf +
     mime = (b'--b'                                      + crlf +
-            b'Content-Disposition: form-data; name="m"' + crlf +
-            password                                    + crlf +
-            str(c.client)             .encode('ascii')  + crlf +
+            b'Content-Disposition: form-data; name="m"' + crlf + crlf +
+            password                                    +   lf +
+            str(c.client)             .encode('ascii')  +   lf +
             str(c.target_outstanding) .encode('ascii')  + crlf +
             str(c.target_outstanding) .encode('ascii')  + crlf +
+          ((
             b'--b'                                      + 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)
 
             b'--b--'                                    + crlf)
 
+    df = open('data.dump.dbg', mode='wb')
+    df.write(mime)
+    df.close()
+
     log_debug(DBG.HTTP_FULL, 'requesting: ' + str(mime))
 
     hh = { 'User-Agent': ['hippotat'],
     log_debug(DBG.HTTP_FULL, 'requesting: ' + str(mime))
 
     hh = { 'User-Agent': ['hippotat'],