mirror of
https://github.com/Mikaela/Limnoria.git
synced 2024-11-23 11:09:23 +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.
|
||||
self.conn.settimeout(max(10, conf.supybot.drivers.poll()*10))
|
||||
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)
|
||||
def setTimeout():
|
||||
self.conn.settimeout(conf.supybot.drivers.poll())
|
||||
conf.supybot.drivers.poll.addCallback(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.resetDelay()
|
||||
except socket.error, e:
|
||||
|
Loading…
Reference in New Issue
Block a user