Initially I've coded backend with zero-size flush just to make sure everything is ok (because I was getting corrupted files with old code).
Your patch relies on assumption that read(2) always returns requested amount of bytes (except EOF) which is not true.
I'm attaching two patches:
01. uses files_upload_session_finish to avoid extra request for large files
02. uses non-chunked files_upload call for small files (less than chunk size).
Hi,
Initially I've coded backend with zero-size flush just to make sure everything is ok (because I was getting corrupted files with old code).
Your patch relies on assumption that read(2) always returns requested amount of bytes (except EOF) which is not true.
I'm attaching two patches: session_ finish to avoid extra request for large files
01. uses files_upload_
02. uses non-chunked files_upload call for small files (less than chunk size).
passes RUN_CODE_TESTS=1 and backendtest.