summaryrefslogtreecommitdiff
path: root/django/core/servers/basehttp.py
diff options
context:
space:
mode:
authorBoulder Sprinters <boulder-sprinters@djangoproject.com>2007-06-18 16:43:17 +0000
committerBoulder Sprinters <boulder-sprinters@djangoproject.com>2007-06-18 16:43:17 +0000
commit750549569ea8d911db0397bd034406d5ce35d923 (patch)
treee516db51e7fb41b457c2caa64f54d7210128840f /django/core/servers/basehttp.py
parent1f09aa1e7b4079e22d1dfcde0f7d4e571389d8b5 (diff)
boulder-oracle-sprint: Merged to [5490]
git-svn-id: http://code.djangoproject.com/svn/django/branches/boulder-oracle-sprint@5491 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/core/servers/basehttp.py')
-rw-r--r--django/core/servers/basehttp.py9
1 files changed, 4 insertions, 5 deletions
diff --git a/django/core/servers/basehttp.py b/django/core/servers/basehttp.py
index 80a0bf6a91..9e603b42d4 100644
--- a/django/core/servers/basehttp.py
+++ b/django/core/servers/basehttp.py
@@ -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)
+ self.write(data, False)
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):
+ def write(self, data, flush=True):
"""'write()' callable as specified by PEP 333"""
assert type(data) is StringType,"write() argument must be string"
@@ -394,7 +394,8 @@ class ServerHandler(object):
# XXX check Content-Length and truncate if too many bytes written?
self._write(data)
- self._flush()
+ if flush:
+ self._flush()
def sendfile(self):
"""Platform-specific file transmission
@@ -421,8 +422,6 @@ 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: