Changeset 63:03c605e48430

Show
Ignore:
Timestamp:
05/17/07 09:08:05 (3 years ago)
Author:
Allan Saddi <allan@saddi.com>
branch:
default
convert_revision:
svn:46762da8-4eb7-0310-94e9-d918b60927c8/flup/trunk@2349
Message:

Fix fcgi_fork so it can run on Solaris.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • ChangeLog

    r61 r63  
     12007-05-17  Allan Saddi  <allan@saddi.com> 
     2 
     3        * Fix fcgi_fork so it can run on Solaris. Thanks to 
     4          Basil Crow for the patch. 
     5 
    162007-01-22  Allan Saddi  <allan@saddi.com> 
    27 
  • flup/server/fcgi_fork.py

    r54 r63  
    9898            # Attempt to glean the maximum number of connections 
    9999            # from the OS. 
    100             maxProcs = resource.getrlimit(resource.RLIMIT_NPROC)[0] 
    101             maxConns = resource.getrlimit(resource.RLIMIT_NOFILE)[0] 
    102             maxConns = min(maxConns, maxProcs) 
     100            try: 
     101                maxProcs = resource.getrlimit(resource.RLIMIT_NPROC)[0] 
     102                maxConns = resource.getrlimit(resource.RLIMIT_NOFILE)[0] 
     103                maxConns = min(maxConns, maxProcs) 
     104            except AttributeError: 
     105                maxConns = resource.getrlimit(resource.RLIMIT_NOFILE)[0] 
    103106        except ImportError: 
    104107            maxConns = 100 # Just some made up number.