home *** CD-ROM | disk | FTP | other *** search
/ PC Professionell 2004 December / PCpro_2004_12.ISO / files / webserver / tsw / TSW_3.4.0.exe / Apache2 / python / apache.pyc (.txt) < prev    next >
Encoding:
Python Compiled Bytecode  |  2004-05-14  |  28.9 KB  |  777 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyc (Python 2.3)
  3.  
  4. import sys
  5. import traceback
  6. import time
  7. import os
  8. import pdb
  9. import stat
  10. import imp
  11. import types
  12. import _apache
  13. _path = None
  14.  
  15. class CallBack:
  16.     '''
  17.     A generic callback object.
  18.     '''
  19.     
  20.     class HStack:
  21.         '''
  22.         The actual stack string lives in the request object so
  23.         it can be manipulated by both apache.py and mod_python.c
  24.         '''
  25.         
  26.         def __init__(self, req):
  27.             self.req = req
  28.  
  29.         
  30.         def pop(self):
  31.             handlers = self.req.hstack.split()
  32.             if not handlers:
  33.                 return None
  34.             else:
  35.                 self.req.hstack = ' '.join(handlers[1:])
  36.                 return handlers[0]
  37.  
  38.  
  39.     
  40.     def ConnectionDispatch(self, conn):
  41.         global _path
  42.         config = conn.base_server.get_config()
  43.         debug = int(config.get('PythonDebug', 0))
  44.         
  45.         try:
  46.             handler = conn.hlist.handler
  47.             l = handler.split('::', 1)
  48.             module_name = l[0]
  49.             if len(l) == 1:
  50.                 object_str = 'connectionhandler'
  51.             else:
  52.                 object_str = l[1]
  53.             if config.has_key('PythonPath'):
  54.                 pathstring = config['PythonPath']
  55.                 if pathstring != _path:
  56.                     _path = pathstring
  57.                     newpath = eval(pathstring)
  58.                     if sys.path != newpath:
  59.                         sys.path[:] = newpath
  60.                     
  61.                 
  62.             
  63.             module = import_module(module_name, autoreload = int(config.get('PythonAutoReload', 1)), log = debug)
  64.             object = resolve_object(module, object_str, arg = conn, silent = 0)
  65.             if object:
  66.                 if config.has_key('PythonEnablePdb'):
  67.                     result = pdb.runcall(object, conn)
  68.                 else:
  69.                     result = object(conn)
  70.                 if not type(result) == type(int()):
  71.                     raise AssertionError, "ConnectionHandler '%s' returned invalid return code." % handler
  72.         except PROG_TRACEBACK:
  73.             traceblock = None
  74.             
  75.             try:
  76.                 (etype, value, traceback) = traceblock
  77.                 result = self.ReportError(etype, value, traceback, srv = conn.base_server, phase = 'ConnectionHandler', hname = handler, debug = debug)
  78.             finally:
  79.                 traceback = None
  80.  
  81.         except:
  82.             
  83.             try:
  84.                 (exc_type, exc_value, exc_traceback) = sys.exc_info()
  85.                 result = self.ReportError(exc_type, exc_value, exc_traceback, srv = conn.base_server, phase = 'ConnectionHandler', hname = handler, debug = debug)
  86.             finally:
  87.                 exc_traceback = None
  88.  
  89.  
  90.         return result
  91.  
  92.     
  93.     def FilterDispatch(self, filter):
  94.         global _path
  95.         req = filter.req
  96.         config = req.get_config()
  97.         debug = int(config.get('PythonDebug', 0))
  98.         
  99.         try:
  100.             l = filter.handler.split('::', 1)
  101.             module_name = l[0]
  102.             if len(l) == 1:
  103.                 if filter.is_input:
  104.                     object_str = 'inputfilter'
  105.                 else:
  106.                     object_str = 'outputfilter'
  107.             else:
  108.                 object_str = l[1]
  109.             if config.has_key('PythonPath'):
  110.                 pathstring = config['PythonPath']
  111.                 if pathstring != _path:
  112.                     _path = pathstring
  113.                     newpath = eval(pathstring)
  114.                     if sys.path != newpath:
  115.                         sys.path[:] = newpath
  116.                     
  117.                 
  118.             elif filter.dir and filter.dir not in sys.path:
  119.                 sys.path[:0] = [
  120.                     filter.dir]
  121.             
  122.             module = import_module(module_name, autoreload = int(config.get('PythonAutoReload', 1)), log = debug)
  123.             object = resolve_object(module, object_str, arg = filter, silent = 0)
  124.             if object:
  125.                 if config.has_key('PythonEnablePdb'):
  126.                     pdb.runcall(object, filter)
  127.                 else:
  128.                     object(filter)
  129.                 filter.flush()
  130.         except SERVER_RETURN:
  131.             value = None
  132.             
  133.             try:
  134.                 if len(value.args) == 2:
  135.                     (result, status) = value.args
  136.                     if status:
  137.                         req.status = status
  138.                     
  139.                 else:
  140.                     result = value.args[0]
  141.                 if type(result) != type(7):
  142.                     s = 'Value raised with SERVER_RETURN is invalid. It is a '
  143.                     s = s + '%s, but it must be a tuple or an int.' % type(result)
  144.                     _apache.log_error(s, APLOG_NOERRNO | APLOG_ERR, req.server)
  145.                     return None
  146.  
  147.         except PROG_TRACEBACK:
  148.             traceblock = None
  149.             
  150.             try:
  151.                 (etype, value, traceback) = traceblock
  152.                 filter.disable()
  153.                 result = self.ReportError(etype, value, traceback, req = req, filter = filter, phase = 'Filter: ' + filter.name, hname = filter.handler, debug = debug)
  154.             finally:
  155.                 traceback = None
  156.  
  157.         except:
  158.             
  159.             try:
  160.                 (exc_type, exc_value, exc_traceback) = sys.exc_info()
  161.                 filter.disable()
  162.                 result = self.ReportError(exc_type, exc_value, exc_traceback, req = req, filter = filter, phase = filter.name, hname = filter.handler, debug = debug)
  163.             finally:
  164.                 exc_traceback = None
  165.  
  166.  
  167.         return OK
  168.  
  169.     
  170.     def HandlerDispatch(self, req):
  171.         '''
  172.         This is the handler dispatcher.
  173.         '''
  174.         global _path
  175.         result = HTTP_INTERNAL_SERVER_ERROR
  176.         config = req.get_config()
  177.         debug = int(config.get('PythonDebug', 0))
  178.         
  179.         try:
  180.             hlist = req.hlist
  181.             while hlist.handler:
  182.                 l = hlist.handler.split('::', 1)
  183.                 module_name = l[0]
  184.                 if len(l) == 1:
  185.                     object_str = req.phase[len('python'):].lower()
  186.                 else:
  187.                     object_str = l[1]
  188.                 if config.has_key('PythonPath'):
  189.                     pathstring = config['PythonPath']
  190.                     if pathstring != _path:
  191.                         _path = pathstring
  192.                         newpath = eval(pathstring)
  193.                         if sys.path != newpath:
  194.                             sys.path[:] = newpath
  195.                         
  196.                     
  197.                 else:
  198.                     dir = hlist.directory
  199.                     if dir and dir not in sys.path:
  200.                         sys.path[:0] = [
  201.                             dir]
  202.                     
  203.                 module = import_module(module_name, autoreload = int(config.get('PythonAutoReload', 1)), log = debug)
  204.                 object = resolve_object(module, object_str, arg = req, silent = hlist.silent)
  205.                 if object:
  206.                     if config.has_key('PythonEnablePdb'):
  207.                         result = pdb.runcall(object, req)
  208.                     else:
  209.                         result = object(req)
  210.                     if not type(result) == type(int()):
  211.                         raise AssertionError, "Handler '%s' returned invalid return code." % hlist.handler
  212.                     if result != OK:
  213.                         break
  214.                     
  215.                 elif hlist.silent:
  216.                     result = DECLINED
  217.                 
  218.                 hlist.next()
  219.         except SERVER_RETURN:
  220.             value = None
  221.             
  222.             try:
  223.                 if len(value.args) == 2:
  224.                     (result, status) = value.args
  225.                     if status:
  226.                         req.status = status
  227.                     
  228.                 else:
  229.                     result = value.args[0]
  230.                 if type(result) != type(7):
  231.                     s = 'Value raised with SERVER_RETURN is invalid. It is a '
  232.                     s = s + '%s, but it must be a tuple or an int.' % type(result)
  233.                     _apache.log_error(s, APLOG_NOERRNO | APLOG_ERR, req.server)
  234.                     return HTTP_INTERNAL_SERVER_ERROR
  235.  
  236.         except PROG_TRACEBACK:
  237.             traceblock = None
  238.             
  239.             try:
  240.                 (etype, value, traceback) = traceblock
  241.                 result = self.ReportError(etype, value, traceback, req = req, phase = req.phase, hname = hlist.handler, debug = debug)
  242.             finally:
  243.                 traceback = None
  244.  
  245.         except:
  246.             
  247.             try:
  248.                 (exc_type, exc_value, exc_traceback) = sys.exc_info()
  249.                 result = self.ReportError(exc_type, exc_value, exc_traceback, req = req, phase = req.phase, hname = hlist.handler, debug = debug)
  250.             finally:
  251.                 exc_traceback = None
  252.  
  253.  
  254.         return result
  255.  
  256.     
  257.     def ReportError(self, etype, evalue, etb, req = None, filter = None, srv = None, phase = 'N/A', hname = 'N/A', debug = 0):
  258.         """ 
  259. \tThis function is only used when debugging is on.
  260. \tIt sends the output similar to what you'd see
  261. \twhen using Python interactively to the browser
  262. \t"""
  263.         
  264.         try:
  265.             if str(etype) == 'exceptions.IOError' and str(evalue)[:5] == 'Write':
  266.                 debug = 0
  267.             
  268.             for e in traceback.format_exception(etype, evalue, etb):
  269.                 s = '%s %s: %s' % (phase, hname, e[:-1])
  270.                 if req:
  271.                     req.log_error(s, APLOG_NOERRNO | APLOG_ERR)
  272.                     continue
  273.                 _apache.log_error(s, APLOG_NOERRNO | APLOG_ERR, srv)
  274.             
  275.             if not debug or not req:
  276.                 return HTTP_INTERNAL_SERVER_ERROR
  277.             else:
  278.                 req.content_type = 'text/html'
  279.                 s = '\n<pre>\nMod_python error: "%s %s"\n\n' % (phase, hname)
  280.                 for e in traceback.format_exception(etype, evalue, etb):
  281.                     s = s + e + '\n'
  282.                 
  283.                 s = s + '</pre>\n'
  284.                 if filter:
  285.                     filter.write(s)
  286.                     filter.flush()
  287.                 else:
  288.                     req.write(s)
  289.                 return DONE
  290.         except:
  291.             traceback.print_exc()
  292.         finally:
  293.             etb = None
  294.  
  295.  
  296.  
  297.  
  298. def import_module(module_name, autoreload = 1, log = 0, path = None):
  299.     '''
  300.     Get the module to handle the request. If
  301.     autoreload is on, then the module will be reloaded
  302.     if it has changed since the last import.
  303.     '''
  304.     if sys.modules.has_key(module_name):
  305.         module = sys.modules[module_name]
  306.         file = module.__dict__.get('__file__')
  307.         if not file and path and not filter(file.startswith, path):
  308.             (mtime, oldmtime) = (0, -1)
  309.         elif autoreload:
  310.             oldmtime = module.__dict__.get('__mtime__', 0)
  311.             mtime = module_mtime(module)
  312.         else:
  313.             (mtime, oldmtime) = (0, 0)
  314.     else:
  315.         (mtime, oldmtime) = (0, -1)
  316.     if mtime > oldmtime:
  317.         if log:
  318.             if path:
  319.                 s = "mod_python: (Re)importing module '%s' with path set to '%s'" % (module_name, path)
  320.             else:
  321.                 s = "mod_python: (Re)importing module '%s'" % module_name
  322.             _apache.log_error(s, APLOG_NOERRNO | APLOG_NOTICE)
  323.         
  324.         parts = module_name.split('.')
  325.         for i in range(len(parts)):
  326.             (f, p, d) = imp.find_module(parts[i], path)
  327.             
  328.             try:
  329.                 mname = '.'.join(parts[:i + 1])
  330.                 module = imp.load_module(mname, f, p, d)
  331.             finally:
  332.                 if f:
  333.                     f.close()
  334.                 
  335.  
  336.             if hasattr(module, '__path__'):
  337.                 path = module.__path__
  338.                 continue
  339.         
  340.         if mtime == 0:
  341.             mtime = module_mtime(module)
  342.         
  343.         module.__mtime__ = mtime
  344.     
  345.     return module
  346.  
  347.  
  348. def module_mtime(module):
  349.     '''Get modification time of module'''
  350.     mtime = 0
  351.     if module.__dict__.has_key('__file__'):
  352.         filepath = module.__file__
  353.         
  354.         try:
  355.             if os.path.exists(filepath):
  356.                 mtime = os.path.getmtime(filepath)
  357.             
  358.             if os.path.exists(filepath[:-1]):
  359.                 mtime = max(mtime, os.path.getmtime(filepath[:-1]))
  360.         except OSError:
  361.             pass
  362.         except:
  363.             None<EXCEPTION MATCH>OSError
  364.         
  365.  
  366.     None<EXCEPTION MATCH>OSError
  367.     return mtime
  368.  
  369.  
  370. def resolve_object(module, object_str, arg = None, silent = 0):
  371.     """
  372.     This function traverses the objects separated by .
  373.     (period) to find the last one we're looking for:
  374.  
  375.        From left to right, find objects, if it is
  376.        an unbound method of a class, instantiate the
  377.        class passing the request as single argument
  378.  
  379.     'arg' is sometimes req, sometimes filter,
  380.     sometimes connection
  381.     """
  382.     obj = module
  383.     for obj_str in object_str.split('.'):
  384.         parent = obj
  385.         if silent and not hasattr(obj, obj_str):
  386.             return None
  387.         
  388.         if obj == module and not hasattr(module, obj_str):
  389.             if hasattr(module, '__file__'):
  390.                 s = "module '%s' contains no '%s'" % (module.__file__, obj_str)
  391.                 raise AttributeError, s
  392.             
  393.         
  394.         obj = getattr(obj, obj_str)
  395.         if hasattr(obj, 'im_self') and not (obj.im_self):
  396.             instance = parent(arg)
  397.             obj = getattr(instance, obj_str)
  398.             continue
  399.     
  400.     return obj
  401.  
  402.  
  403. def build_cgi_env(req):
  404.     '''
  405.     Utility function that returns a dictionary of
  406.     CGI environment variables as described in
  407.     http://hoohoo.ncsa.uiuc.edu/cgi/env.html
  408.     '''
  409.     req.add_common_vars()
  410.     env = req.subprocess_env.copy()
  411.     if len(req.path_info) > 0:
  412.         env['SCRIPT_NAME'] = req.uri[:-len(req.path_info)]
  413.     else:
  414.         env['SCRIPT_NAME'] = req.uri
  415.     env['GATEWAY_INTERFACE'] = 'Python-CGI/1.1'
  416.     if req.headers_in.has_key('authorization'):
  417.         env['HTTP_AUTHORIZATION'] = req.headers_in['authorization']
  418.     
  419.     return env
  420.  
  421.  
  422. class NullIO:
  423.     ''' Abstract IO
  424.     '''
  425.     
  426.     def tell(self):
  427.         return 0
  428.  
  429.     
  430.     def read(self, n = -1):
  431.         return ''
  432.  
  433.     
  434.     def readline(self, length = None):
  435.         return ''
  436.  
  437.     
  438.     def readlines(self):
  439.         return []
  440.  
  441.     
  442.     def write(self, s):
  443.         pass
  444.  
  445.     
  446.     def writelines(self, list):
  447.         self.write(''.join(list))
  448.  
  449.     
  450.     def isatty(self):
  451.         return 0
  452.  
  453.     
  454.     def flush(self):
  455.         pass
  456.  
  457.     
  458.     def close(self):
  459.         pass
  460.  
  461.     
  462.     def seek(self, pos, mode = 0):
  463.         pass
  464.  
  465.  
  466.  
  467. class CGIStdin(NullIO):
  468.     
  469.     def __init__(self, req):
  470.         self.pos = 0
  471.         self.req = req
  472.         self.BLOCK = 65536
  473.         self.buf = ''
  474.  
  475.     
  476.     def read(self, n = -1):
  477.         if n == 0:
  478.             return ''
  479.         
  480.         if n == -1:
  481.             s = self.req.read(self.BLOCK)
  482.             while s:
  483.                 self.buf = self.buf + s
  484.                 self.pos = self.pos + len(s)
  485.                 s = self.req.read(self.BLOCK)
  486.             result = self.buf
  487.             self.buf = ''
  488.             return result
  489.         elif self.buf:
  490.             s = self.buf[:n]
  491.             n = n - len(s)
  492.         else:
  493.             s = ''
  494.         s = s + self.req.read(n)
  495.         self.pos = self.pos + len(s)
  496.         return s
  497.  
  498.     
  499.     def readlines(self):
  500.         s = (self.buf + self.read()).split('\n')
  501.         return map((lambda s: s + '\n'), s)
  502.  
  503.     
  504.     def readline(self, n = -1):
  505.         if n == 0:
  506.             return ''
  507.         
  508.         self.buf = self.buf + self.req.read(self.BLOCK)
  509.         i = self.buf.find('\n')
  510.         while i == -1:
  511.             if n != -1 and len(self.buf) >= n:
  512.                 i = n - 1
  513.                 break
  514.             
  515.             x = len(self.buf)
  516.             self.buf = self.buf + self.req.read(self.BLOCK)
  517.             if len(self.buf) == x:
  518.                 i = x - 1
  519.                 break
  520.             
  521.             i = self.buf.find('\n', x)
  522.         result = self.buf[:i + 1]
  523.         self.buf = self.buf[i + 1:]
  524.         self.pos = self.pos + len(result)
  525.         return result
  526.  
  527.  
  528.  
  529. class CGIStdout(NullIO):
  530.     '''
  531.     Class that allows writing to the socket directly for CGI.
  532.     '''
  533.     
  534.     def __init__(self, req):
  535.         self.pos = 0
  536.         self.req = req
  537.         self.headers_sent = 0
  538.         self.headers = ''
  539.  
  540.     
  541.     def write(self, s):
  542.         if not s:
  543.             return None
  544.         
  545.         if not (self.headers_sent):
  546.             self.headers = self.headers + s
  547.             headers_over = 0
  548.             ss = self.headers.split('\r\n\r\n', 1)
  549.             if len(ss) < 2:
  550.                 ss = self.headers.split('\n\n', 1)
  551.                 if len(ss) >= 2:
  552.                     headers_over = 1
  553.                 
  554.             else:
  555.                 headers_over = 1
  556.             if headers_over:
  557.                 ss[0] = ss[0].replace('\r\n', '\n')
  558.                 lines = ss[0].split('\n')
  559.                 for line in lines:
  560.                     (h, v) = line.split(':', 1)
  561.                     v = v.strip()
  562.                     if h.lower() == 'status':
  563.                         status = int(v.split()[0])
  564.                         self.req.status = status
  565.                         continue
  566.                     if h.lower() == 'content-type':
  567.                         self.req.content_type = v
  568.                         self.req.headers_out[h] = v
  569.                         continue
  570.                     self.req.headers_out.add(h, v)
  571.                 
  572.                 self.headers_sent = 1
  573.                 self.req.write(ss[1])
  574.             
  575.         else:
  576.             self.req.write(str(s))
  577.         self.pos = self.pos + len(s)
  578.  
  579.     
  580.     def tell(self):
  581.         return self.pos
  582.  
  583.  
  584.  
  585. def setup_cgi(req):
  586.     '''
  587.     Replace sys.stdin and stdout with an objects that read/write to
  588.     the socket, as well as substitute the os.environ.
  589.     Returns (environ, stdin, stdout) which you must save and then use
  590.     with restore_nocgi().
  591.     '''
  592.     save_env = os.environ.copy()
  593.     si = sys.stdin
  594.     so = sys.stdout
  595.     os.environ.update(build_cgi_env(req))
  596.     sys.stdout = CGIStdout(req)
  597.     sys.stdin = CGIStdin(req)
  598.     sys.argv = []
  599.     return (save_env, si, so)
  600.  
  601.  
  602. def restore_nocgi(sav_env, si, so):
  603.     ''' see setup_cgi() '''
  604.     osenv = os.environ
  605.     for k in osenv.keys():
  606.         del osenv[k]
  607.     
  608.     for k in sav_env:
  609.         osenv[k] = sav_env[k]
  610.     
  611.     sys.stdout = si
  612.     sys.stdin = so
  613.  
  614.  
  615. def init():
  616.     ''' 
  617.         This function is called by the server at startup time
  618.     '''
  619.     return CallBack()
  620.  
  621. make_table = _apache.table
  622. log_error = _apache.log_error
  623. table = _apache.table
  624. config_tree = _apache.config_tree
  625. server_root = _apache.server_root
  626. mpm_query = _apache.mpm_query
  627. HTTP_CONTINUE = 100
  628. HTTP_SWITCHING_PROTOCOLS = 101
  629. HTTP_PROCESSING = 102
  630. HTTP_OK = 200
  631. HTTP_CREATED = 201
  632. HTTP_ACCEPTED = 202
  633. HTTP_NON_AUTHORITATIVE = 203
  634. HTTP_NO_CONTENT = 204
  635. HTTP_RESET_CONTENT = 205
  636. HTTP_PARTIAL_CONTENT = 206
  637. HTTP_MULTI_STATUS = 207
  638. HTTP_MULTIPLE_CHOICES = 300
  639. HTTP_MOVED_PERMANENTLY = 301
  640. HTTP_MOVED_TEMPORARILY = 302
  641. HTTP_SEE_OTHER = 303
  642. HTTP_NOT_MODIFIED = 304
  643. HTTP_USE_PROXY = 305
  644. HTTP_TEMPORARY_REDIRECT = 307
  645. HTTP_BAD_REQUEST = 400
  646. HTTP_UNAUTHORIZED = 401
  647. HTTP_PAYMENT_REQUIRED = 402
  648. HTTP_FORBIDDEN = 403
  649. HTTP_NOT_FOUND = 404
  650. HTTP_METHOD_NOT_ALLOWED = 405
  651. HTTP_NOT_ACCEPTABLE = 406
  652. HTTP_PROXY_AUTHENTICATION_REQUIRED = 407
  653. HTTP_REQUEST_TIME_OUT = 408
  654. HTTP_CONFLICT = 409
  655. HTTP_GONE = 410
  656. HTTP_LENGTH_REQUIRED = 411
  657. HTTP_PRECONDITION_FAILED = 412
  658. HTTP_REQUEST_ENTITY_TOO_LARGE = 413
  659. HTTP_REQUEST_URI_TOO_LARGE = 414
  660. HTTP_UNSUPPORTED_MEDIA_TYPE = 415
  661. HTTP_RANGE_NOT_SATISFIABLE = 416
  662. HTTP_EXPECTATION_FAILED = 417
  663. HTTP_UNPROCESSABLE_ENTITY = 422
  664. HTTP_LOCKED = 423
  665. HTTP_FAILED_DEPENDENCY = 424
  666. HTTP_INTERNAL_SERVER_ERROR = 500
  667. HTTP_NOT_IMPLEMENTED = 501
  668. HTTP_BAD_GATEWAY = 502
  669. HTTP_SERVICE_UNAVAILABLE = 503
  670. HTTP_GATEWAY_TIME_OUT = 504
  671. HTTP_VERSION_NOT_SUPPORTED = 505
  672. HTTP_VARIANT_ALSO_VARIES = 506
  673. HTTP_INSUFFICIENT_STORAGE = 507
  674. HTTP_NOT_EXTENDED = 510
  675.  
  676. try:
  677.     import syslog
  678.     APLOG_EMERG = syslog.LOG_EMERG
  679.     APLOG_ALERT = syslog.LOG_ALERT
  680.     APLOG_CRIT = syslog.LOG_CRIT
  681.     APLOG_ERR = syslog.LOG_ERR
  682.     APLOG_WARNING = syslog.LOG_WARNING
  683.     APLOG_NOTICE = syslog.LOG_NOTICE
  684.     APLOG_INFO = syslog.LOG_INFO
  685.     APLOG_DEBUG = syslog.LOG_DEBUG
  686. except ImportError:
  687.     APLOG_EMERG = 0
  688.     APLOG_ALERT = 1
  689.     APLOG_CRIT = 2
  690.     APLOG_ERR = 3
  691.     APLOG_WARNING = 4
  692.     APLOG_NOTICE = 5
  693.     APLOG_INFO = 6
  694.     APLOG_DEBUG = 7
  695.  
  696. APLOG_NOERRNO = 8
  697. OK = REQ_PROCEED = 0
  698. DONE = -2
  699. DECLINED = REQ_NOACTION = -1
  700. REMOTE_HOST = 0
  701. REMOTE_NAME = 1
  702. REMOTE_NOLOOKUP = 2
  703. REMOTE_DOUBLE_REV = 3
  704. REQ_ABORTED = HTTP_INTERNAL_SERVER_ERROR
  705. REQ_EXIT = 'REQ_EXIT'
  706. SERVER_RETURN = _apache.SERVER_RETURN
  707. PROG_TRACEBACK = 'PROG_TRACEBACK'
  708. FINFO_MODE = 0
  709. FINFO_INO = 1
  710. FINFO_DEV = 2
  711. FINFO_NLINK = 3
  712. FINFO_UID = 4
  713. FINFO_GID = 5
  714. FINFO_SIZE = 6
  715. FINFO_ATIME = 7
  716. FINFO_MTIME = 8
  717. FINFO_CTIME = 9
  718. FINFO_FNAME = 10
  719. FINFO_NAME = 11
  720. URI_SCHEME = 0
  721. URI_HOSTINFO = 1
  722. URI_USER = 2
  723. URI_PASSWORD = 3
  724. URI_HOSTNAME = 4
  725. URI_PORT = 5
  726. URI_PATH = 6
  727. URI_QUERY = 7
  728. URI_FRAGMENT = 8
  729. PROXYREQ_NONE = 0
  730. PROXYREQ_PROXY = 1
  731. PROXYREQ_REVERSE = 2
  732. M_GET = 0
  733. M_PUT = 1
  734. M_POST = 2
  735. M_DELETE = 3
  736. M_CONNECT = 4
  737. M_OPTIONS = 5
  738. M_TRACE = 6
  739. M_PATCH = 7
  740. M_PROPFIND = 8
  741. M_PROPPATCH = 9
  742. M_MKCOL = 10
  743. M_COPY = 11
  744. M_MOVE = 12
  745. M_LOCK = 13
  746. M_UNLOCK = 14
  747. M_VERSION_CONTROL = 15
  748. M_CHECKOUT = 16
  749. M_UNCHECKOUT = 17
  750. M_CHECKIN = 18
  751. M_UPDATE = 19
  752. M_LABEL = 20
  753. M_REPORT = 21
  754. M_MKWORKSPACE = 22
  755. M_MKACTIVITY = 23
  756. M_BASELINE_CONTROL = 24
  757. M_MERGE = 25
  758. M_INVALID = 26
  759. AP_REQ_ACCEPT_PATH_INFO = 0
  760. AP_REQ_REJECT_PATH_INFO = 1
  761. AP_REQ_DEFAULT_PATH_INFO = 2
  762. AP_MPMQ_NOT_SUPPORTED = 0
  763. AP_MPMQ_STATIC = 1
  764. AP_MPMQ_DYNAMIC = 2
  765. AP_MPMQ_MAX_DAEMON_USED = 1
  766. AP_MPMQ_IS_THREADED = 2
  767. AP_MPMQ_IS_FORKED = 3
  768. AP_MPMQ_HARD_LIMIT_DAEMONS = 4
  769. AP_MPMQ_HARD_LIMIT_THREADS = 5
  770. AP_MPMQ_MAX_THREADS = 6
  771. AP_MPMQ_MIN_SPARE_DAEMONS = 7
  772. AP_MPMQ_MIN_SPARE_THREADS = 8
  773. AP_MPMQ_MAX_SPARE_DAEMONS = 9
  774. AP_MPMQ_MAX_SPARE_THREADS = 10
  775. AP_MPMQ_MAX_REQUESTS_DAEMON = 11
  776. AP_MPMQ_MAX_DAEMONS = 12
  777.