raku-libcurl icon indicating copy to clipboard operation
raku-libcurl copied to clipboard

"Failed writing received data to disk/application" error on windows

Open hythm7 opened this issue 1 year ago • 1 comments

Testing the module on windows by running this simple script:

use LibCurl::Easy;

print LibCurl::Easy.new(URL => 'http://google.com').perform.content;

produces the below error:

Failed writing received data to disk/application
  in method throw at 'SETTING::'src/core.c/Exception.pm6 line 65
  in sub die at 'SETTING::'src/core.c/control.pm6 line 255
  in method perform at
C:\Users\grunt-win\libcurl-test\..\raku-libcurl\lib\LibCurl\Easy.rakumod
(LibCurl::Easy) line 673
  in block <unit> at .\t\libcurl.rakutest line 8

curl.dll file installed on my windows system by downloading from libcurl website, then copying it to C:\Windows\System32\curl.dll

hythm7 avatar Jul 07 '23 16:07 hythm7

Looks like libcurl throws this error CURLE_WRITE_ERROR when the return value of &writefunction callback is not correct.

I added debug code in writefunction and run a test comparing a successful request on Linux machine with a failed request on Windows machine

On Linux the response size returned from the server was 17194, and writefunction was called three times, first returned 2640, second returned 11264 and third returned 3290, correctly adding up to 17194.

On Windows writefunction was called only one time returning 1416, (which was supposed to run multiple times until write all 17194 size)

hythm7 avatar Jul 08 '23 01:07 hythm7