Changeset 7377
- Timestamp:
- 07/22/2008 01:40:29 PM (5 weeks ago)
- Location:
- trunk/trac/web
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/trac/web/api.py
r7051 r7377 30 30 from trac.util.datefmt import http_date, localtz 31 31 from trac.web.href import Href 32 from trac.web.wsgi import _FileWrapper 32 33 33 34 HTTP_STATUS = dict([(code, reason.title()) for code, (reason, description) … … 401 402 402 403 if self.method != 'HEAD': 403 self._response = file(path, 'rb') 404 file_wrapper = self.environ.get('wsgi.file_wrapper') 405 if file_wrapper: 406 self._response = file_wrapper(self._response, 4096) 404 fileobj = file(path, 'rb') 405 file_wrapper = self.environ.get('wsgi.file_wrapper', _FileWrapper) 406 self._response = file_wrapper(fileobj, 4096) 407 407 raise RequestDone 408 408 -
trunk/trac/web/wsgi.py
r6904 r7377 87 87 response = application(self.environ, self._start_response) 88 88 try: 89 if isinstance(response, self.wsgi_file_wrapper) \ 89 if self.wsgi_file_wrapper is not None \ 90 and isinstance(response, self.wsgi_file_wrapper) \ 90 91 and hasattr(self, '_sendfile'): 91 92 self._sendfile(response.fileobj)
