From 27d20a54d66133102bfd05e148bb2381a22c0b1c Mon Sep 17 00:00:00 2001 From: debian Date: Tue, 14 Apr 2015 05:11:30 -0400 Subject: [PATCH] remove keep alive because it consume too many resource --- README.md | 2 +- goagent/3.1.48/local/connect_manager.py | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index f02918ca97..18ed2b0b9c 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ XX-Net 下载链接: ========== -https://codeload.github.com/XX-net/XX-Net/zip/1.8.6 +https://codeload.github.com/XX-net/XX-Net/zip/1.8.7 (1.8.3之前的用户,请重新部署服务端) diff --git a/goagent/3.1.48/local/connect_manager.py b/goagent/3.1.48/local/connect_manager.py index 2389b3a093..75bc6d78f2 100644 --- a/goagent/3.1.48/local/connect_manager.py +++ b/goagent/3.1.48/local/connect_manager.py @@ -155,6 +155,7 @@ def to_string(self): class Https_connection_manager(object): thread_num_lock = threading.Lock() + keep_alive = False def __init__(self): # http://docs.python.org/dev/library/ssl.html @@ -179,9 +180,10 @@ def __init__(self): if hasattr(OpenSSL.SSL, 'SESS_CACHE_BOTH'): self.openssl_context.set_session_cache_mode(OpenSSL.SSL.SESS_CACHE_BOTH) - p = threading.Thread(target = self.keep_alive_thread) - p.daemon = True - p.start() + if self.keep_alive: + p = threading.Thread(target = self.keep_alive_thread) + p.daemon = True + p.start() self.keep_alive = True