Changeset 149
- Timestamp:
- 02/13/05 08:59:27
- Files:
-
- trunk/cherrypy/_cpconfig.py (modified) (6 diffs)
- trunk/cherrypy/_cpthreadinglocal.py (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/cherrypy/_cpconfig.py
r108 r149 53 53 54 54 # Parameters used to tell what kind of server we want 55 # Note that numberOfProcesses, threading and forking conflict56 # wich each other: if one has a non-null value, the other57 # ones should be null (for numberOfProcesses, null means equal to one)58 cpg.configOption.processPool = 0 # Used if we want to fork n processes59 # at the beginning. In this case, all60 # processes will listen on the same61 # socket (this only works on unix)62 cpg.configOption.threading = 0 # Used if we want to create a new63 # thread for each request64 cpg.configOption.forking = 0 # Used if we want to create a new process65 # for each request66 55 cpg.configOption.threadPool = 0 # Used if we want to create a pool 67 56 # of threads at the beginning … … 115 104 ('server', 'socketFile', 'str'), 116 105 ('server', 'reverseDNS', 'int'), 117 ('server', 'processPool', 'int'),118 106 ('server', 'threadPool', 'int'), 119 ('server', 'threading', 'int'),120 ('server', 'forking', 'int'),121 107 ('server', 'sslKeyFile', 'str'), 122 108 ('server', 'sslCertificateFile', 'str'), … … 158 144 _cpLogMessage(" reverseDNS: %s" % cpg.configOption.reverseDNS, 'CONFIG') 159 145 _cpLogMessage(" socketQueueSize: %s" % cpg.configOption.socketQueueSize, 'CONFIG') 160 _cpLogMessage(" processPool: %s" % cpg.configOption.processPool, 'CONFIG')161 146 _cpLogMessage(" threadPool: %s" % cpg.configOption.threadPool, 'CONFIG') 162 _cpLogMessage(" threading: %s" % cpg.configOption.threading, 'CONFIG')163 _cpLogMessage(" forking: %s" % cpg.configOption.forking, 'CONFIG')164 147 _cpLogMessage(" sslKeyFile: %s" % cpg.configOption.sslKeyFile, 'CONFIG') 165 148 if cpg.configOption.sslKeyFile: … … 183 166 if _reverseDNS not in (0,1): raise "CherryError: reverseDNS must be '0' or '1'" 184 167 if _socketFile and not hasattr(socket, 'AF_UNIX'): raise "CherryError: Configuration file has socketFile, but this is only available on Unix machines" 185 if _processPool!=1 and not hasattr(os, 'fork'): raise "CherryError: Configuration file has processPool, but forking is not available on this operating system"186 if _forking and not hasattr(os, 'fork'): raise "CherryError: Configuration file has forking, but forking is not available on this operating system"187 168 if _sslKeyFile: 188 169 try: … … 192 173 if _socketPort and _socketFile: raise "CherryError: In configuration file: socketPort and socketFile conflict with each other" 193 174 if not _socketFile and not _socketPort: _socketPort=8000 # Default port 194 if _processPool==1: severalProcs=0195 else: severalProcs=1196 if _threadPool==1: severalThreads=0197 else: severalThreads=1198 if severalThreads+severalProcs+_threading+_forking>1: raise "CherryError: In configuration file: threadPool, processPool, threading and forking conflict with each other"199 175 if _sslKeyFile and not _sslCertificateFile: raise "CherryError: Configuration file has sslKeyFile but no sslCertificateFile" 200 176 if _sslCertificateFile and not _sslKeyFile: raise "CherryError: Configuration file has sslCertificateFile but no sslKeyFile" … … 205 181 if _sessionStorageType in ('custom', 'ram', 'cookie') and _sessionStorageFileDir!='': raise "CherryError: Configuration file has sessionStorageType set to 'custom, 'ram' or 'cookie' but a sessionStorageFileDir is specified" 206 182 if _sessionStorageType=='file' and _sessionStorageFileDir=='': raise "CherryError: Configuration file has sessionStorageType set to 'file' but no sessionStorageFileDir" 207 if _sessionStorageType=='ram' and (_forking or severalProcs):208 print "CherryWarning: 'ram' sessions might be buggy when using several processes"209 183 trunk/cherrypy/_cpthreadinglocal.py
r148 r149 1 # This is a backport of Python-2.4's threading.local() implementation 2 1 3 """Thread-local objects 2 4

