Kaydet (Commit) 42e0b7f4 authored tarafından Giampaolo Rodolà's avatar Giampaolo Rodolà

asyncore: introduce a new 'closed' attribute to make sure that dispatcher gets closed only once.

In different occasions close() might be called more than once, causing problems with already disconnected sockets/dispatchers.
üst 2933312f
...@@ -220,7 +220,7 @@ class dispatcher: ...@@ -220,7 +220,7 @@ class dispatcher:
connected = False connected = False
accepting = False accepting = False
closing = False closed = False
addr = None addr = None
ignore_log_types = frozenset(['warning']) ignore_log_types = frozenset(['warning'])
...@@ -393,6 +393,8 @@ class dispatcher: ...@@ -393,6 +393,8 @@ class dispatcher:
raise raise
def close(self): def close(self):
if not self.closed:
self.closed = True
self.connected = False self.connected = False
self.accepting = False self.accepting = False
self.del_channel() self.del_channel()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment