add more debugging to write_expecting_echo
authorCameron Patrick <cameron@ucc.gu.uwa.edu.au>
Sun, 1 Aug 2004 06:39:06 +0000 (06:39 +0000)
committerCameron Patrick <cameron@ucc.gu.uwa.edu.au>
Sun, 1 Aug 2004 06:39:06 +0000 (06:39 +0000)
sql-edition/servers/LATClient.py

index ffa8963..dedc1ff 100644 (file)
@@ -28,9 +28,14 @@ def write_expecting_echo(rfh, wfh, message):
        while len(message) > 0:
                wfh.write(message[0])
                wfh.flush()
-               echo = rfh.read(1)
-               if echo != message[0]:
-                       print "Gah, expected echo when writing", message[0]
+               if message[0] == '\n':
+                       echo = rfh.read(2)
+                       expected_echo = '\r\n'
+               else:
+                       echo = rfh.read(1)
+                       expected_echo = message[0]
+               if echo != expected_echo:
+                       print "Gah, expected echo when writing", repr(message[0]), "but got", repr(echo)
                message = message[1:]
        print "  --> Sent and echoed."
 

UCC git Repository :: git.ucc.asn.au