From a8fea8e4a846e7b8358fe752782981b6ade8287b Mon Sep 17 00:00:00 2001 From: Miroslav Stampar Date: Thu, 3 Feb 2011 15:09:53 +0000 Subject: [PATCH] fix for a bug noticed when using --keep-alive --threads on IIS/MSSQL --- extra/keepalive/keepalive.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/extra/keepalive/keepalive.py b/extra/keepalive/keepalive.py index ecae85d75..705e4702f 100644 --- a/extra/keepalive/keepalive.py +++ b/extra/keepalive/keepalive.py @@ -97,8 +97,8 @@ class HTTPHandler(urllib2.HTTPHandler): """return a list of connected hosts""" retVal = [] currentThread = threading.currentThread() - for thread, host in self._connections.keys(): - if thread == currentThread: + for name, host in self._connections.keys(): + if name == currentThread.getName(): retVal.append(host) return retVal @@ -115,7 +115,7 @@ class HTTPHandler(urllib2.HTTPHandler): del self._connections[key] def _get_connection_key(self, host): - return (threading.currentThread(), host) + return (threading.currentThread().getName(), host) def _start_connection(self, h, req): h.clearheaders()