1. Alex Willmer
  2. trac-ticketlinks

Commits

mgood  committed 012b97c

oops I didn't mean to check in the FastCGI changes with [2432]

  • Participants
  • Parent commits 6bf7f17
  • Branches trunk

Comments (0)

Files changed (1)

File trac/web/fcgi_frontend.py

View file
  • Ignore whitespace
 from trac.web.main import dispatch_request, get_environment, \
                           send_pretty_error, send_project_index
 
-import _thfcgi
-#import _fcgi
+import _fcgi
 import os
 import locale
 
 def run():
     locale.setlocale(locale.LC_ALL, '')
-    _thfcgi.THFCGI(_handler).run()
-    #_fcgi.Server(_handler).run()
+    _fcgi.Server(_handler).run()
 
-class FCGIRequest(CGIRequest):
-    def __init__(self, environ, input, output, fieldStorage):
-        self._fieldStorage = fieldStorage
-        CGIRequest.__init__(self, environ, input, output)
 
-    def _getFieldStorage(self):
-        return self._fieldStorage
-
-
-def _handler(_req, _env, _fieldStorage):
-    req = FCGIRequest(_env, _req.stdin, _req.out, _fieldStorage)
+def _handler(_req):
+    req = CGIRequest(_req.params, _req.stdin, _req.stdout)
     env = get_environment(req, os.environ)
 
     if not env:
         send_project_index(req, os.environ)
-        return
+        return _fcgi.CGI_REQUEST_COMPLETE, 0
 
     try:  
         dispatch_request(req.path_info, req, env)
     except Exception, e:
         send_pretty_error(e, env, req)
-    return
+    return _fcgi.FCGI_REQUEST_COMPLETE, 0