Menu

#1286 libcurl stopes upload to file:// url if CURL_READFUNC_PAUSE is returned

closed-fixed
None
5
2014-08-26
2013-10-02
Maxim
No

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

1 Attachments

Discussion

  • Daniel Stenberg

    Daniel Stenberg - 2013-10-02
    • assigned_to: Daniel Stenberg
     
  • Daniel Stenberg

    Daniel Stenberg - 2013-10-02

    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.

     
  • Daniel Stenberg

    Daniel Stenberg - 2013-12-24
    • status: open --> open-confirmed
     
  • Daniel Stenberg

    Daniel Stenberg - 2013-12-24

    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.

     
  • Daniel Stenberg

    Daniel Stenberg - 2013-12-26
    • status: open-confirmed --> closed-fixed
     
  • Daniel Stenberg

    Daniel Stenberg - 2013-12-26

    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!