Changeset 15:fdeee42dffd9
- Timestamp:
- 05/18/05 16:13:01
(3 years ago)
- Author:
- Allan Saddi <allan@saddi.com>
- branch:
- default
- convert_revision:
- svn:46762da8-4eb7-0310-94e9-d918b60927c8/flup/trunk@1787
- Message:
Change default allowedServers for ajp and scgi to 127.0.0.1?.
Accept PATH_INFO from environment for scgi servers, in case
cgi2scgi is being used.
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r14 |
r15 |
|
| 1 | 1 | 2005-05-18 Allan Saddi <asaddi@ganymede.saddi.net> |
|---|
| 2 | 2 | |
|---|
| | 3 | * Change default allowedServers for ajp and scgi to ['127.0.0.1']. |
|---|
| | 4 | * Accept PATH_INFO from environment for scgi servers, in case |
|---|
| | 5 | cgi2scgi is being used. Submitted by Ian Bicking. |
|---|
| 3 | 6 | * Change threaded servers so wsgi.multiprocess is False by default. |
|---|
| 4 | 7 | Allow it to be changed by keyword argument. |
|---|
| r14 |
r15 |
|
| 43 | 43 | |
|---|
| 44 | 44 | __all__ = ['BaseAJPServer'] |
|---|
| | 45 | |
|---|
| | 46 | class NoDefault(object): |
|---|
| | 47 | pass |
|---|
| 45 | 48 | |
|---|
| 46 | 49 | # Packet header prefixes. |
|---|
| … | … | |
| 759 | 762 | def __init__(self, application, scriptName='', environ=None, |
|---|
| 760 | 763 | multithreaded=True, multiprocess=False, |
|---|
| 761 | | bindAddress=('localhost', 8009), allowedServers=None, |
|---|
| | 764 | bindAddress=('localhost', 8009), allowedServers=NoDefault, |
|---|
| 762 | 765 | loggingLevel=logging.INFO): |
|---|
| 763 | 766 | """ |
|---|
| … | … | |
| 782 | 785 | allowedServers must be None or a list of strings representing the |
|---|
| 783 | 786 | IPv4 addresses of servers allowed to connect. None means accept |
|---|
| 784 | | connections from anywhere. |
|---|
| | 787 | connections from anywhere. By default, it is a list containing |
|---|
| | 788 | the single item '127.0.0.1'. |
|---|
| 785 | 789 | |
|---|
| 786 | 790 | loggingLevel sets the logging level of the module-level logger. |
|---|
| … | … | |
| 795 | 799 | self.multiprocess = multiprocess |
|---|
| 796 | 800 | self._bindAddress = bindAddress |
|---|
| | 801 | if allowedServers is NoDefault: |
|---|
| | 802 | allowedServers = ['127.0.0.1'] |
|---|
| 797 | 803 | self._allowedServers = allowedServers |
|---|
| 798 | 804 | |
|---|
| r14 |
r15 |
|
| 44 | 44 | __all__ = ['BaseSCGIServer'] |
|---|
| 45 | 45 | |
|---|
| | 46 | class NoDefault(object): |
|---|
| | 47 | pass |
|---|
| | 48 | |
|---|
| 46 | 49 | # The main classes use this name for logging. |
|---|
| 47 | 50 | LoggerName = 'scgi-wsgi' |
|---|
| … | … | |
| 270 | 273 | def __init__(self, application, scriptName='', environ=None, |
|---|
| 271 | 274 | multithreaded=True, multiprocess=False, |
|---|
| 272 | | bindAddress=('localhost', 4000), allowedServers=None, |
|---|
| | 275 | bindAddress=('localhost', 4000), allowedServers=NoDefault, |
|---|
| 273 | 276 | loggingLevel=logging.INFO): |
|---|
| 274 | 277 | """ |
|---|
| … | … | |
| 293 | 296 | allowedServers must be None or a list of strings representing the |
|---|
| 294 | 297 | IPv4 addresses of servers allowed to connect. None means accept |
|---|
| 295 | | connections from anywhere. |
|---|
| | 298 | connections from anywhere. By default, it is a list containing |
|---|
| | 299 | the single item '127.0.0.1'. |
|---|
| 296 | 300 | |
|---|
| 297 | 301 | loggingLevel sets the logging level of the module-level logger. |
|---|
| … | … | |
| 306 | 310 | self.multiprocess = multiprocess |
|---|
| 307 | 311 | self._bindAddress = bindAddress |
|---|
| | 312 | if allowedServers is NoDefault: |
|---|
| | 313 | allowedServers = ['127.0.0.1'] |
|---|
| 308 | 314 | self._allowedServers = allowedServers |
|---|
| 309 | 315 | |
|---|
| … | … | |
| 439 | 445 | # Namely SCRIPT_NAME/PATH_INFO |
|---|
| 440 | 446 | value = environ['SCRIPT_NAME'] |
|---|
| | 447 | # Pull PATH_INFO from environ, if it exists. (cgi2scgi actually |
|---|
| | 448 | # passes it in.) |
|---|
| | 449 | value += environ.get('PATH_INFO', '') |
|---|
| 441 | 450 | scriptName = self.scriptName |
|---|
| 442 | 451 | if not value.startswith(scriptName): |
|---|