Merge pull request #342 from channelcat/fix-slow-upload
Fix slow upload
This commit is contained in:
commit
88c3bffe20
|
@ -54,7 +54,7 @@ class Request(dict):
|
|||
self.query_string = url_parsed.query.decode('utf-8')
|
||||
|
||||
# Init but do not inhale
|
||||
self.body = None
|
||||
self.body = []
|
||||
self.parsed_json = None
|
||||
self.parsed_form = None
|
||||
self.parsed_files = None
|
||||
|
|
|
@ -148,12 +148,11 @@ class HttpProtocol(asyncio.Protocol):
|
|||
)
|
||||
|
||||
def on_body(self, body):
|
||||
if self.request.body:
|
||||
self.request.body += body
|
||||
else:
|
||||
self.request.body = body
|
||||
self.request.body.append(body)
|
||||
|
||||
def on_message_complete(self):
|
||||
if self.request.body:
|
||||
self.request.body = b''.join(self.request.body)
|
||||
self._request_handler_task = self.loop.create_task(
|
||||
self.request_handler(self.request, self.write_response))
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user