mirror of
https://github.com/django/django.git
synced 2025-10-24 14:16:09 +00:00
Fixed #9659: fixed wsgi.file_wrapper in the builtin server. Thanks, mitsuhiko.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@10690 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -306,14 +306,15 @@ class ServerHandler(object):
|
||||
env.setdefault('SERVER_SOFTWARE',self.server_software)
|
||||
|
||||
def finish_response(self):
|
||||
"""Send any iterable data, then close self and the iterable
|
||||
|
||||
Subclasses intended for use in asynchronous servers will
|
||||
want to redefine this method, such that it sets up callbacks
|
||||
in the event loop to iterate over the data, and to call
|
||||
'self.close()' once the response is finished.
|
||||
"""
|
||||
if not self.result_is_file() and not self.sendfile():
|
||||
Send any iterable data, then close self and the iterable
|
||||
|
||||
Subclasses intended for use in asynchronous servers will want to
|
||||
redefine this method, such that it sets up callbacks in the event loop
|
||||
to iterate over the data, and to call 'self.close()' once the response
|
||||
is finished.
|
||||
"""
|
||||
if not self.result_is_file() or not self.sendfile():
|
||||
for data in self.result:
|
||||
self.write(data)
|
||||
self.finish_content()
|
||||
|
||||
Reference in New Issue
Block a user