Skip to content
Snippets Groups Projects
Commit 9768940b authored by dkirov's avatar dkirov
Browse files

show connect failure dialog when Unhandled data

is received (wrong protocol)
parent ad1ec1ab
No related branches found
No related tags found
No related merge requests found
......@@ -247,6 +247,8 @@ class NonBlockingTcp(PlugIn, IdleObject):
# This should never happed, so we need the debug
self.DEBUG('Unhandled data received: %s' % received,'got')
self.disconnect()
if self.on_connect_failure:
self.on_connect_failure()
return True
def _do_send(self):
......@@ -415,7 +417,7 @@ class NonBlockingTLS(PlugIn):
''' Immidiatedly switch socket to TLS mode. Used internally.'''
tcpsock=self._owner.Connection
tcpsock._sock.setblocking(True)
tcpsock._sslObj = socket.ssl(tcpsock._sock, None, None)
tcpsock._sslObj = socket.ssl(tcpsock._sock, None, None)
tcpsock._sock.setblocking(False)
tcpsock._sslIssuer = tcpsock._sslObj.issuer()
tcpsock._sslServer = tcpsock._sslObj.server()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment