close handling fix

- don't close a connection twice
This commit is contained in:
Peter Šurda 2017-11-14 23:43:05 +01:00
parent d2f79d3172
commit 1792289e00
Signed by: PeterSurda
GPG Key ID: 0C5F50C0B5F37D87

View File

@ -236,7 +236,7 @@ class BMConnectionPool(object):
i.append_write_buf(protocol.CreatePacket('ping')) i.append_write_buf(protocol.CreatePacket('ping'))
else: else:
i.close_reason = "Timeout (%is)" % (time.time() - i.lastTx) i.close_reason = "Timeout (%is)" % (time.time() - i.lastTx)
i.handle_close() i.set_state("close")
for i in self.inboundConnections.values() + self.outboundConnections.values() + self.listeningSockets.values() + self.udpSockets.values(): for i in self.inboundConnections.values() + self.outboundConnections.values() + self.listeningSockets.values() + self.udpSockets.values():
if i.state == "close": if i.state == "close":
i.handle_close() i.handle_close()