try:
yield self.parseRequests() # parse http requests
except ConnectionClosed:
- yield self.connectionClosed()
+ #yield self.connectionClosed()
if _debug: print 'parse connection closed'
def writeMessage(self, message):
print "parseRequest headers", repr(self.hr.headers), str(self.hr.headers)
try:
yield self.messageReceived(self.hr)
+ except ConnectionClosed:
+ if _debug:
+ print 'parseRequests, ConnectionClosed '
+ raise StopIteration
+
except:
if _debug:
print 'messageReceived', \
def connectionClosed(self):
'''Called when the client drops the connection'''
if _debug: 'Client.connectionClosed'
+ #self.writeMessage(None)
+ #yield self.queue.put((None,None))
if self.stream.sock:
yield self.stream.close()
else:
yield None
- #self.writeMessage(None)
- #yield self.queue.put((None,None))
def messageReceived(self, msg):
if _debug: print 'messageReceived cmd=', msg.command, msg.path