From b8f93704268ba0de9380bde7efe7a196f0b1c939 Mon Sep 17 00:00:00 2001 From: clowwindy Date: Thu, 1 May 2014 11:21:05 +0800 Subject: [PATCH] fix close --- shadowsocks/udprelay.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/shadowsocks/udprelay.py b/shadowsocks/udprelay.py index 92e89cf..d926e30 100644 --- a/shadowsocks/udprelay.py +++ b/shadowsocks/udprelay.py @@ -135,7 +135,8 @@ class UDPRelay(object): self._timeout = timeout self._is_local = is_local self._eventloop = eventloop.EventLoop() - self._cache = lru_cache.LRUCache(timeout=timeout) + self._cache = lru_cache.LRUCache(timeout=timeout, + close_callback=self._close_client) self._client_fd_to_server_addr = lru_cache.LRUCache(timeout=timeout) def _close_client(self, client):