Comment 2 for bug 1573957

Revision history for this message
Dmitry Nezhevenko (dmitry.nezhevenko) wrote :

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:
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).

passes RUN_CODE_TESTS=1 and backendtest.