Back to index

moin  1.9.0~rc2
Classes | Functions | Variables
MoinMoin.support.flup.server.fcgi_base Namespace Reference

Classes

class  InputStream
class  MultiplexedInputStream
class  OutputStream
class  TeeOutputStream
class  StdoutWrapper
class  Record
class  Request
class  CGIRequest
class  Connection
class  MultiplexedConnection
class  BaseFCGIServer

Functions

def _debug
def decode_pair
def encode_pair

Variables

string __author__ = 'Allan Saddi <allan@saddi.com>'
string __version__ = '$Revision$'
 thread_available = True
list __all__ = ['BaseFCGIServer']
int FCGI_LISTENSOCK_FILENO = 0
int FCGI_HEADER_LEN = 8
int FCGI_VERSION_1 = 1
int FCGI_BEGIN_REQUEST = 1
int FCGI_ABORT_REQUEST = 2
int FCGI_END_REQUEST = 3
int FCGI_PARAMS = 4
int FCGI_STDIN = 5
int FCGI_STDOUT = 6
int FCGI_STDERR = 7
int FCGI_DATA = 8
int FCGI_GET_VALUES = 9
int FCGI_GET_VALUES_RESULT = 10
int FCGI_UNKNOWN_TYPE = 11
 FCGI_MAXTYPE = FCGI_UNKNOWN_TYPE
int FCGI_NULL_REQUEST_ID = 0
int FCGI_KEEP_CONN = 1
int FCGI_RESPONDER = 1
int FCGI_AUTHORIZER = 2
int FCGI_FILTER = 3
int FCGI_REQUEST_COMPLETE = 0
int FCGI_CANT_MPX_CONN = 1
int FCGI_OVERLOADED = 2
int FCGI_UNKNOWN_ROLE = 3
string FCGI_MAX_CONNS = 'FCGI_MAX_CONNS'
string FCGI_MAX_REQS = 'FCGI_MAX_REQS'
string FCGI_MPXS_CONNS = 'FCGI_MPXS_CONNS'
string FCGI_Header = '!BBHHBx'
string FCGI_BeginRequestBody = '!HB5x'
string FCGI_EndRequestBody = '!LB3x'
string FCGI_UnknownTypeBody = '!B7x'
tuple FCGI_EndRequestBody_LEN = struct.calcsize(FCGI_EndRequestBody)
tuple FCGI_UnknownTypeBody_LEN = struct.calcsize(FCGI_UnknownTypeBody)
int DEBUG = 0
string DEBUGLOG = '/tmp/fcgi.log'

Function Documentation

def MoinMoin.support.flup.server.fcgi_base._debug (   level,
  msg 
) [private]

Definition at line 107 of file fcgi_base.py.

00107 
00108     def _debug(level, msg):
00109         if DEBUG < level:
00110             return
00111 
00112         try:
00113             f = open(DEBUGLOG, 'a')
00114             f.write('%sfcgi: %s\n' % (time.ctime()[4:-4], msg))
00115             f.close()
00116         except:
00117             pass

Here is the caller graph for this function:

Decodes a name/value pair.

The number of bytes decoded as well as the name/value pair
are returned.

Definition at line 379 of file fcgi_base.py.

00379 
00380 def decode_pair(s, pos=0):
00381     """
00382     Decodes a name/value pair.
00383 
00384     The number of bytes decoded as well as the name/value pair
00385     are returned.
00386     """
00387     nameLength = ord(s[pos])
00388     if nameLength & 128:
00389         nameLength = struct.unpack('!L', s[pos:pos+4])[0] & 0x7fffffff
00390         pos += 4
00391     else:
00392         pos += 1
00393 
00394     valueLength = ord(s[pos])
00395     if valueLength & 128:
00396         valueLength = struct.unpack('!L', s[pos:pos+4])[0] & 0x7fffffff
00397         pos += 4
00398     else:
00399         pos += 1
00400 
00401     name = s[pos:pos+nameLength]
00402     pos += nameLength
00403     value = s[pos:pos+valueLength]
00404     pos += valueLength
00405 
00406     return (pos, (name, value))

Here is the caller graph for this function:

Encodes a name/value pair.

The encoded string is returned.

Definition at line 407 of file fcgi_base.py.

00407 
00408 def encode_pair(name, value):
00409     """
00410     Encodes a name/value pair.
00411 
00412     The encoded string is returned.
00413     """
00414     nameLength = len(name)
00415     if nameLength < 128:
00416         s = chr(nameLength)
00417     else:
00418         s = struct.pack('!L', nameLength | 0x80000000L)
00419 
00420     valueLength = len(value)
00421     if valueLength < 128:
00422         s += chr(valueLength)
00423     else:
00424         s += struct.pack('!L', valueLength | 0x80000000L)
00425 
00426     return s + name + value
    

Here is the caller graph for this function:


Variable Documentation

Definition at line 53 of file fcgi_base.py.

string MoinMoin.support.flup.server.fcgi_base.__author__ = 'Allan Saddi <allan@saddi.com>'

Definition at line 27 of file fcgi_base.py.

Definition at line 28 of file fcgi_base.py.

Definition at line 104 of file fcgi_base.py.

Definition at line 105 of file fcgi_base.py.

Definition at line 63 of file fcgi_base.py.

Definition at line 80 of file fcgi_base.py.

Definition at line 62 of file fcgi_base.py.

Definition at line 93 of file fcgi_base.py.

Definition at line 84 of file fcgi_base.py.

Definition at line 69 of file fcgi_base.py.

Definition at line 64 of file fcgi_base.py.

Definition at line 94 of file fcgi_base.py.

Definition at line 97 of file fcgi_base.py.

Definition at line 81 of file fcgi_base.py.

Definition at line 70 of file fcgi_base.py.

Definition at line 71 of file fcgi_base.py.

Definition at line 92 of file fcgi_base.py.

Definition at line 58 of file fcgi_base.py.

Definition at line 77 of file fcgi_base.py.

Definition at line 56 of file fcgi_base.py.

Definition at line 88 of file fcgi_base.py.

Definition at line 89 of file fcgi_base.py.

Definition at line 73 of file fcgi_base.py.

Definition at line 90 of file fcgi_base.py.

Definition at line 75 of file fcgi_base.py.

Definition at line 85 of file fcgi_base.py.

Definition at line 65 of file fcgi_base.py.

Definition at line 83 of file fcgi_base.py.

Definition at line 79 of file fcgi_base.py.

Definition at line 68 of file fcgi_base.py.

Definition at line 66 of file fcgi_base.py.

Definition at line 67 of file fcgi_base.py.

Definition at line 86 of file fcgi_base.py.

Definition at line 72 of file fcgi_base.py.

Definition at line 95 of file fcgi_base.py.

Definition at line 98 of file fcgi_base.py.

Definition at line 60 of file fcgi_base.py.

Definition at line 43 of file fcgi_base.py.