cosmetic change
authorThomasV <thomasv@gitorious>
Sat, 27 Oct 2012 10:31:43 +0000 (12:31 +0200)
committerThomasV <thomasv@gitorious>
Sat, 27 Oct 2012 10:31:43 +0000 (12:31 +0200)
lib/interface.py

index 488b89a..c843679 100644 (file)
@@ -256,15 +256,20 @@ class Interface(threading.Thread):
         try:
             out = ''
             while self.is_connected:
+
                 try: 
+                    timeout = False
                     msg = self.s.recv(1024)
                 except socket.timeout:
-                    # ping the server with server.version, as a real ping does not exist yet
-                    self.send([('server.version', [ELECTRUM_VERSION])])
-                    continue
+                    timeout = True
                 except ssl.SSLError:
+                    timeout = True
+
+                if timeout:
+                    # ping the server with server.version, as a real ping does not exist yet
                     self.send([('server.version', [ELECTRUM_VERSION])])
                     continue
+
                 out += msg
                 self.bytes_received += len(msg)
                 if msg == '':