Currently if you upload a small file with user upload, it will claim that it uploaded the whole file super fast, like 50MB/s or something. Then it will hang for a bit before exiting.
Of course, what's really happening is that the file was simply copied into the upload buffer super fast, and the hanging at the end is when the file was actually being uploaded.
Fortunately, there's an easy fix: just call Sync after each Write call, and treat each Write+Sync as one write when calculating the speed.
Currently if you upload a small file with
user upload
, it will claim that it uploaded the whole file super fast, like 50MB/s or something. Then it will hang for a bit before exiting.Of course, what's really happening is that the file was simply copied into the upload buffer super fast, and the hanging at the end is when the file was actually being uploaded.
Fortunately, there's an easy fix: just call
Sync
after eachWrite
call, and treat eachWrite
+Sync
as one write when calculating the speed.