Skip to content

Commit

Permalink
0-byte uploads are completed after the InitiateFileUploads call already
Browse files Browse the repository at this point in the history
  • Loading branch information
aduffeck committed Jan 18, 2024
1 parent 69840c2 commit 27ee194
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/core/cs3iface.py
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,11 @@ def writefile(endpoint, filepath, userid, content, lockmd, islock=False):
log.warning(f'msg="Access denied uploading file to Reva" reason="{putres.reason}"')
raise IOError(common.ACCESS_ERROR)
if putres.status_code != http.client.OK:
if len(content) == 0: # 0-byte file uploads are finalized after the InitiateFileUploadRequest request already
log.info('msg="0-byte file written successfully" filepath="%s" elapsedTimems="%.1f" islock="%s"' %
(filepath, (tend - tstart) * 1000, islock))
return

log.error('msg="Error uploading file to Reva" code="%d" reason="%s"' % (putres.status_code, putres.reason))
raise IOError(putres.reason)
log.info('msg="File written successfully" filepath="%s" elapsedTimems="%.1f" islock="%s"' %
Expand Down

0 comments on commit 27ee194

Please sign in to comment.