aboutsummaryrefslogtreecommitdiff
path: root/scripts/async-http.py
diff options
context:
space:
mode:
authorRob Austein <sra@hactrn.net>2009-04-29 20:21:22 +0000
committerRob Austein <sra@hactrn.net>2009-04-29 20:21:22 +0000
commit38343510de72d5d6ab4a21fbef150d6d2de5f25a (patch)
tree87e2909a4f2b922d990322fd1b43dbe888e810fd /scripts/async-http.py
parent309dad3781b2259d9dccf59a87c9896c91f56ebd (diff)
Checkpoint
svn path=/scripts/async-http.py; revision=2376
Diffstat (limited to 'scripts/async-http.py')
-rw-r--r--scripts/async-http.py23
1 files changed, 20 insertions, 3 deletions
diff --git a/scripts/async-http.py b/scripts/async-http.py
index fe7847b7..b33cbc5d 100644
--- a/scripts/async-http.py
+++ b/scripts/async-http.py
@@ -256,13 +256,30 @@ class http_client(http_stream):
self.set_terminator(None)
def handle_message(self):
+ try:
+ msg = self.narrator.done_msg(self.hostport)
+ print "Query:"
+ print msg
+ print
+ except IndexError:
+ #
+ # This is not a good test. If we get here, we certainly have an
+ # unsolicited message, but if we get an unsolicited message with
+ # something in the queue we will get confused and match up the
+ # wrong query and reply. Needs fixing.
+ #
+ print "[Received unsolicited message]"
if debug: print "[Connection %s persistent]" % ("is" if self.msg.persistent() else "isn't")
- print "Query:"
- print self.narrator.done_msg(self.hostport)
- print
print "Reply:"
print self.msg
print
+ #
+ # Hmm, this is probably the first place where the persistence
+ # handling is confused. Why are we even looking for a next
+ # message when the connection should close? Fixing this may
+ # simplify unsnarling the rest of the client-side persistence
+ # hairball.
+ #
self.next_msg(first = False)
def handle_connect(self):