keep proxies in separate dictionary
[multitaskhttpd.git] / httpd.py
index e5596008db886e92184fdf64e19f84821cfbc19a..e87272ed81412974714a5f564d1e0dd7a947352b 100644 (file)
--- a/httpd.py
+++ b/httpd.py
@@ -63,6 +63,7 @@ throw an exception and display the error message.
 import os, sys, time, struct, socket, traceback, multitask
 import threading, Queue
 import uuid
+import select
 from string import strip
 
 from BaseHTTPServer import BaseHTTPRequestHandler
@@ -310,7 +311,12 @@ class Protocol(object):
             # over to "standard" HTTPRequestHandler, the data's already
             # there.
             print "parseRequests"
-            readok = (yield multitask.readable(self.stream.sock, 5000))
+            try:
+                readok = (yield multitask.readable(self.stream.sock, 5000))
+            except select.error:
+                print "select error: connection closed"
+                raise ConnectionClosed
+
             print "readok", readok
             print
             raw_requestline = (yield self.stream.readline())
@@ -677,6 +683,7 @@ class HTTPServer(object):
                 else:
                     print "cookies", str(msg.response_cookies)
                     session = msg.response_cookies['session'].value
+                    client.session = session
                     name = msg.path
                     print "serverlistener", name
                     if '*' not in self.apps and name not in self.apps: