3 Dec 01:05
Re: Multiple ports and SSL
From: RichardC <richardcrichardc@...>
Subject: Re: Multiple ports and SSL
Newsgroups: gmane.comp.python.cherrypy
Date: 2008-12-03 00:05:33 GMT
Subject: Re: Multiple ports and SSL
Newsgroups: gmane.comp.python.cherrypy
Date: 2008-12-03 00:05:33 GMT
So it turns out that if you create two instances of CherryPyWSGIServer
they will share the same environment dictionary 'environ', which
causes problem when one is for HTTP and the other is for HTTPS. This
confused the hell out of me all morning. Here is the change so they
have separate 'environ's.
diff -ru cherrypyp1/wsgiserver/__init__.py cherrypyp2/wsgiserver/
__init__.py
--- cherrypyp1/wsgiserver/__init__.py 2008-12-01 13:36:18.000000000
+1300
+++ cherrypyp2/wsgiserver/__init__.py 2008-12-03 12:56:33.000000000
+1300
@@ -1464,7 +1464,7 @@
nodelay = True
ConnectionClass = HTTPConnection
- environ = {}
+ environ = None
# Paths to certificate and private key files
ssl_certificate = None
@@ -1474,6 +1474,9 @@
max=-1, request_queue_size=5, timeout=10,
shutdown_timeout=5):
self.requests = ThreadPool(self, min=numthreads or 1,
max=max)
+ if not self.environ:
+ self.environ = {}
(Continue reading)
RSS Feed