2
0
mirror of https://github.com/xcat2/confluent.git synced 2024-11-28 20:39:40 +00:00

Fix client file staging

Skip read during httpapi, and inject sleep between file transfer chunks.
This commit is contained in:
Jarrod Johnson 2024-09-27 15:30:59 -04:00
parent 2fa56f4a38
commit 3ad53a3aac
2 changed files with 2 additions and 1 deletions

View File

@ -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)

View File

@ -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)