Fix nemubot shutdown when some DCC connections are alive
This commit is contained in:
parent
6c6a11b80c
commit
3a82cc00cd
3
DCC.py
3
DCC.py
@ -22,6 +22,7 @@ import re
|
||||
import socket
|
||||
import sys
|
||||
import time
|
||||
import threading
|
||||
import traceback
|
||||
|
||||
import message
|
||||
@ -202,7 +203,7 @@ class DCC(server.Server):
|
||||
if self.realname in self.srv.dcc_clients:
|
||||
del self.srv.dcc_clients[self.realname]
|
||||
|
||||
print ("Close connection with", self.nick)
|
||||
print ("Closing connection with", self.nick)
|
||||
self.stopping.set()
|
||||
#Rearm Thread
|
||||
threading.Thread.__init__(self)
|
||||
|
@ -194,7 +194,8 @@ class IRCServer(server.Server):
|
||||
def disconnect(self):
|
||||
"""Close the socket with the server and all DCC client connections"""
|
||||
#Close all DCC connection
|
||||
for clt in self.dcc_clients:
|
||||
clts = [c for c in self.dcc_clients]
|
||||
for clt in clts:
|
||||
self.dcc_clients[clt].disconnect()
|
||||
return server.Server.disconnect(self)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user