Back to index

moin  1.9.0~rc2
Classes | Functions | Variables
MoinMoin.support.flup.client.fcgi_app Namespace Reference

Classes

class  Record
class  FCGIApp

Functions

def _debug
def decode_pair
def encode_pair

Variables

string __author__ = 'Allan Saddi <allan@saddi.com>'
string __version__ = '$Revision$'
list __all__ = ['FCGIApp']
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_BeginRequestBody_LEN = struct.calcsize(FCGI_BeginRequestBody)
tuple FCGI_EndRequestBody_LEN = struct.calcsize(FCGI_EndRequestBody)
tuple FCGI_UnknownTypeBody_LEN = struct.calcsize(FCGI_UnknownTypeBody)
int DEBUG = 0
string DEBUGLOG = '/tmp/fcgi_app.log'
tuple app = FCGIApp(connect=('localhost', 4242))

Function Documentation

def MoinMoin.support.flup.client.fcgi_app._debug (   level,
  msg 
) [private]

Definition at line 90 of file fcgi_app.py.

00090 
00091     def _debug(level, msg):
00092         if DEBUG < level:
00093             return
00094 
00095         try:
00096             f = open(DEBUGLOG, 'a')
00097             f.write('%sfcgi: %s\n' % (time.ctime()[4:-4], msg))
00098             f.close()
00099         except:
00100             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 101 of file fcgi_app.py.

00101 
00102 def decode_pair(s, pos=0):
00103     """
00104     Decodes a name/value pair.
00105 
00106     The number of bytes decoded as well as the name/value pair
00107     are returned.
00108     """
00109     nameLength = ord(s[pos])
00110     if nameLength & 128:
00111         nameLength = struct.unpack('!L', s[pos:pos+4])[0] & 0x7fffffff
00112         pos += 4
00113     else:
00114         pos += 1
00115 
00116     valueLength = ord(s[pos])
00117     if valueLength & 128:
00118         valueLength = struct.unpack('!L', s[pos:pos+4])[0] & 0x7fffffff
00119         pos += 4
00120     else:
00121         pos += 1
00122 
00123     name = s[pos:pos+nameLength]
00124     pos += nameLength
00125     value = s[pos:pos+valueLength]
00126     pos += valueLength
00127 
00128     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 129 of file fcgi_app.py.

00129 
00130 def encode_pair(name, value):
00131     """
00132     Encodes a name/value pair.
00133 
00134     The encoded string is returned.
00135     """
00136     nameLength = len(name)
00137     if nameLength < 128:
00138         s = chr(nameLength)
00139     else:
00140         s = struct.pack('!L', nameLength | 0x80000000L)
00141 
00142     valueLength = len(value)
00143     if valueLength < 128:
00144         s += chr(valueLength)
00145     else:
00146         s += struct.pack('!L', valueLength | 0x80000000L)
00147 
00148     return s + name + value

Here is the caller graph for this function:


Variable Documentation

Definition at line 35 of file fcgi_app.py.

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

Definition at line 27 of file fcgi_app.py.

Definition at line 28 of file fcgi_app.py.

tuple MoinMoin.support.flup.client.fcgi_app.app = FCGIApp(connect=('localhost', 4242))

Definition at line 458 of file fcgi_app.py.

Definition at line 87 of file fcgi_app.py.

string MoinMoin.support.flup.client.fcgi_app.DEBUGLOG = '/tmp/fcgi_app.log'

Definition at line 88 of file fcgi_app.py.

Definition at line 45 of file fcgi_app.py.

Definition at line 62 of file fcgi_app.py.

Definition at line 44 of file fcgi_app.py.

Definition at line 75 of file fcgi_app.py.

Definition at line 79 of file fcgi_app.py.

Definition at line 66 of file fcgi_app.py.

Definition at line 51 of file fcgi_app.py.

Definition at line 46 of file fcgi_app.py.

Definition at line 76 of file fcgi_app.py.

Definition at line 80 of file fcgi_app.py.

Definition at line 63 of file fcgi_app.py.

Definition at line 52 of file fcgi_app.py.

Definition at line 53 of file fcgi_app.py.

Definition at line 74 of file fcgi_app.py.

Definition at line 40 of file fcgi_app.py.

Definition at line 59 of file fcgi_app.py.

Definition at line 38 of file fcgi_app.py.

Definition at line 70 of file fcgi_app.py.

Definition at line 71 of file fcgi_app.py.

Definition at line 55 of file fcgi_app.py.

Definition at line 72 of file fcgi_app.py.

Definition at line 57 of file fcgi_app.py.

Definition at line 67 of file fcgi_app.py.

Definition at line 47 of file fcgi_app.py.

Definition at line 65 of file fcgi_app.py.

Definition at line 61 of file fcgi_app.py.

Definition at line 50 of file fcgi_app.py.

Definition at line 48 of file fcgi_app.py.

Definition at line 49 of file fcgi_app.py.

Definition at line 68 of file fcgi_app.py.

Definition at line 54 of file fcgi_app.py.

Definition at line 77 of file fcgi_app.py.

Definition at line 81 of file fcgi_app.py.

Definition at line 42 of file fcgi_app.py.