mirror of
https://github.com/xcat2/confluent.git
synced 2024-11-25 02:52:07 +00:00
Fix client file staging
Skip read during httpapi, and inject sleep between file transfer chunks.
This commit is contained in:
parent
2fa56f4a38
commit
3ad53a3aac
@ -1343,6 +1343,7 @@ def handle_staging(pathcomponents, operation, configmanager, inputdata):
|
||||
datachunk = filedata['wsgi.input'].read(min(chunk_size, remaining_length))
|
||||
f.write(datachunk)
|
||||
remaining_length -= len(datachunk)
|
||||
eventlet.sleep(0)
|
||||
yield msg.FileUploadProgress(progress)
|
||||
yield msg.FileUploadProgress(100)
|
||||
|
||||
|
@ -681,7 +681,7 @@ def resourcehandler_backend(env, start_response):
|
||||
start_response('302 Found', headers)
|
||||
yield ''
|
||||
return
|
||||
if 'CONTENT_LENGTH' in env and int(env['CONTENT_LENGTH']) > 0:
|
||||
if 'CONTENT_LENGTH' in env and int(env['CONTENT_LENGTH']) > 0 and not '/staging' in env['PATH_INFO']:
|
||||
reqbody = env['wsgi.input'].read(int(env['CONTENT_LENGTH']))
|
||||
reqtype = env['CONTENT_TYPE']
|
||||
operation = opmap.get(env['REQUEST_METHOD'], None)
|
||||
|
Loading…
Reference in New Issue
Block a user