1
0
mirror of https://github.com/django/django.git synced 2025-10-23 21:59:11 +00:00

Backed out the changes in [5482] for a bit whilst some more investigation into

side-effects is done. Refs #4565.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@5511 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick
2007-06-22 07:15:04 +00:00
parent dbebf54d6c
commit 880e3cfaa6
21 changed files with 162 additions and 284 deletions

View File

@@ -309,7 +309,7 @@ class ServerHandler(object):
"""
if not self.result_is_file() and not self.sendfile():
for data in self.result:
self.write(data, False)
self.write(data)
self.finish_content()
self.close()
@@ -377,7 +377,7 @@ class ServerHandler(object):
else:
self._write('Status: %s\r\n' % self.status)
def write(self, data, flush=True):
def write(self, data):
"""'write()' callable as specified by PEP 333"""
assert type(data) is StringType,"write() argument must be string"
@@ -394,8 +394,7 @@ class ServerHandler(object):
# XXX check Content-Length and truncate if too many bytes written?
self._write(data)
if flush:
self._flush()
self._flush()
def sendfile(self):
"""Platform-specific file transmission
@@ -422,6 +421,8 @@ class ServerHandler(object):
if not self.headers_sent:
self.headers['Content-Length'] = "0"
self.send_headers()
else:
pass # XXX check if content-length was too short?
def close(self):
try: