parent
a0a27d9cb2
commit
e9038f2220
|
@ -27,6 +27,7 @@ from common.zeroconf import zeroconf
|
||||||
|
|
||||||
from nbxmpp.protocol import *
|
from nbxmpp.protocol import *
|
||||||
import socket
|
import socket
|
||||||
|
import ssl
|
||||||
import errno
|
import errno
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
|
@ -515,14 +516,14 @@ class P2PConnection(IdleObject, PlugIn):
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
errnum = e.errno
|
errnum = e.errno
|
||||||
# "received" will be empty anyhow
|
# "received" will be empty anyhow
|
||||||
if errnum == socket.SSL_ERROR_WANT_READ:
|
if errnum == ssl.SSL_ERROR_WANT_READ:
|
||||||
pass
|
pass
|
||||||
elif errnum in [errno.ECONNRESET, errno.ENOTCONN, errno.ESHUTDOWN]:
|
elif errnum in [errno.ECONNRESET, errno.ENOTCONN, errno.ESHUTDOWN]:
|
||||||
self.pollend()
|
self.pollend()
|
||||||
# don't proccess result, cas it will raise error
|
# don't proccess result, cas it will raise error
|
||||||
return
|
return
|
||||||
elif not received :
|
elif not received :
|
||||||
if errnum != socket.SSL_ERROR_EOF:
|
if errnum != ssl.SSL_ERROR_EOF:
|
||||||
# 8 EOF occurred in violation of protocol
|
# 8 EOF occurred in violation of protocol
|
||||||
self.pollend()
|
self.pollend()
|
||||||
if self.state >= 0:
|
if self.state >= 0:
|
||||||
|
@ -583,7 +584,7 @@ class P2PConnection(IdleObject, PlugIn):
|
||||||
self._on_send()
|
self._on_send()
|
||||||
|
|
||||||
except socket.error as e:
|
except socket.error as e:
|
||||||
if e.errno == socket.SSL_ERROR_WANT_WRITE:
|
if e.errno == ssl.SSL_ERROR_WANT_WRITE:
|
||||||
return True
|
return True
|
||||||
if self.state < 0:
|
if self.state < 0:
|
||||||
self.disconnect()
|
self.disconnect()
|
||||||
|
|
Loading…
Reference in New Issue