chiark / gitweb /
wip debug
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 1 Apr 2017 12:20:43 +0000 (13:20 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 1 Apr 2017 12:20:43 +0000 (13:20 +0100)
client
server
w3mstracetodump

diff --git a/client b/client
index 5d0f427..c9682bd 100755 (executable)
--- a/client
+++ b/client
@@ -105,8 +105,8 @@ def check_outbound():
     lf   =   b'\n'
     mime = (b'--b'                                      + crlf +
             b'Content-Disposition: form-data; name="m"' + crlf + crlf +
-            password                                    +   lf +
-            str(c.client)             .encode('ascii')  +   lf +
+            password                                    + crlf +
+            str(c.client)             .encode('ascii')  + crlf +
             str(c.target_outstanding) .encode('ascii')  + crlf +
           ((
             b'--b'                                      + crlf +
diff --git a/server b/server
index 1f65255..68f8541 100755 (executable)
--- a/server
+++ b/server
@@ -137,9 +137,9 @@ class Client():
 def process_request(request, desca):
   # find client, update config, etc.
   metadata = request.args['m']
-  metadata = metadata.split(b'\n')
-  (ci_s, pw, tro) = metadata.split(b'\n')[0:3]
-  desca['m'] = [ci_s, tro]
+  metadata = metadata.split(b'\r\n')
+  (ci_s, pw, tro) = metadata[0:3]
+  desca['m[0,2]'] = [ci_s, tro]
   ci = ipaddr(ci_s)
   desca['ci'] = ci
   cl = clients[ci]
index bb9305e..fdf28eb 100755 (executable)
@@ -1,5 +1,7 @@
 #!/usr/bin/perl -n
 
+# strace -s70000 -ot w3m ./form.html
+
 next unless s{^write\(7, "}{};
 next unless m/^POST|GET/..0;
 s{", \d+\)\s+= \d+\n}{};