Fix nemubot shutdown when some DCC connections are alive

This commit is contained in:
Némunaire 2012-11-02 13:58:34 +01:00
parent 6c6a11b80c
commit 3a82cc00cd
2 changed files with 4 additions and 2 deletions

3
DCC.py
View File

@ -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)

View File

@ -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)