mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-27 13:19:24 +01:00
Socket: Fix race condition in SSL handshakes.
This commit is contained in:
parent
881eb9f771
commit
cac96aa5f7
@ -278,14 +278,14 @@ class SocketDriver(drivers.IrcDriver, drivers.ServersMixin):
|
|||||||
# At least 10 seconds.
|
# At least 10 seconds.
|
||||||
self.conn.settimeout(max(10, conf.supybot.drivers.poll()*10))
|
self.conn.settimeout(max(10, conf.supybot.drivers.poll()*10))
|
||||||
try:
|
try:
|
||||||
|
if getattr(conf.supybot.networks, self.irc.network).ssl():
|
||||||
|
assert globals().has_key('ssl')
|
||||||
|
self.conn = ssl.wrap_socket(self.conn)
|
||||||
self.conn.connect(server)
|
self.conn.connect(server)
|
||||||
def setTimeout():
|
def setTimeout():
|
||||||
self.conn.settimeout(conf.supybot.drivers.poll())
|
self.conn.settimeout(conf.supybot.drivers.poll())
|
||||||
conf.supybot.drivers.poll.addCallback(setTimeout)
|
conf.supybot.drivers.poll.addCallback(setTimeout)
|
||||||
setTimeout()
|
setTimeout()
|
||||||
if getattr(conf.supybot.networks, self.irc.network).ssl():
|
|
||||||
assert globals().has_key('ssl')
|
|
||||||
self.conn = ssl.wrap_socket(self.conn)
|
|
||||||
self.connected = True
|
self.connected = True
|
||||||
self.resetDelay()
|
self.resetDelay()
|
||||||
except socket.error, e:
|
except socket.error, e:
|
||||||
|
Loading…
Reference in New Issue
Block a user