Whenever I return CURL_READFUNC_PAUSE from read_callback function the upload stops.
A test code is attached.
Checked with the latest version from git (as of 1 Oct 2013, commit 3d43a487813a94dc8521bd8d970725efbd922bf7)
for the given test file I've got the following output:
handles OK
read_callback: try read 16384, paused 0
read_callback: try read 16384, paused 0
pause
upload result: No error
resume
upload result: No error
upload finished at 1
upload result: No error
upload finished at 2
upload result: No error
upload finished at 3
upload result: No error
upload finished at 4
PS The file is actually is created but it stored only the first block.
$ ll /tmp/curloutfile.tmp
-rw-r--r-- 1 max max 16384 Oct. 2 14:57 /tmp/curloutfile.tmp
The description doesn't make it terribly clear that:
1 - the example uses the multi interface and
2 - the paused transfer is being resumed almost immediately (to no effect)
... my notes after having read the example source.
FILE:// transfers do not and will not support pausing. I intend to add this to the documentation and I'll work on fixing the code to ignore the return code in that case.
The reason for not supporting it, is that FILE:// is using plain files and we cannot easily just wait like we do for other (network) protocols since Windows won't allow us to select/poll then.
commit 2a4ee0d22155 introduces proper checks for trying to do this and documents this limitation properly. We don't support pausing of transfers done with FILE://.
Thanks for your report. Case closed!