forgot to add proxyapp. committing current state which is a bit broken on 2nd request
[multitaskhttpd.git] / httpd.py
index 55c10900a79298815fc15bc3854c453680210a8a..6dc90c4acaa36816e9dea7b24990bdec198152de 100644 (file)
--- a/httpd.py
+++ b/httpd.py
@@ -324,14 +324,17 @@ class Protocol(object):
                 raise ConnectionClosed 
 
             self.hr.raw_requestline = raw_requestline
+            pos = self.hr.rfile.tell()
+            #self.hr.rfile.truncate(0)
             self.hr.rfile.write(data)
             print "parseRequests write after"
-            self.hr.rfile.seek(0)
+            self.hr.rfile.seek(pos)
             print "parseRequests seek after"
 
             if not self.hr.parse_request():
                 raise ConnectionClosed 
             print "parseRequests parse_req after"
+            print "parseRequest headers", repr(self.hr.headers), str(self.hr.headers)
             try:
                 yield self.messageReceived(self.hr)
             except:
@@ -502,6 +505,7 @@ class Client(Protocol):
         if _debug: print 'messageReceived cmd=', msg.command, msg.path
         msg.response_cookies = process_cookies(msg.headers, self.remote)
 
+        # slightly bad, this: read everything, put it into memory...
         if msg.headers.has_key('content-length'):
             max_chunk_size = 10*1024*1024
             size_remaining = int(msg.headers["content-length"])