You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
libcurl provides a WRITEFUNCTIONoption to process response chunks. Its behavior is to abort the download if returned integer is not equal to the length of passed chunk.
Your callback should return the number of bytes actually taken care of. If that amount differs from the amount passed to your callback function, it signals an error condition to the library. This causes the transfer to get aborted and the libcurl function used returns CURLE_WRITE_ERROR.
It looks like instead of E_WRITE_ERROR, latest libcurl-impersonate is returning E_RECV_ERROR which breaks the abort functionality and makes it impossible to differentiate between server side receive errors/timeouts and on-purpose aborts.
Test Case
Following is the minimal test case with pycurl that can be used to reproduce this:
Error 23 (E_WRITE_ERROR) is the expected code, which allows client to handle on-purpose aborts and process the result. Something got broken in latest impersonation patch or maybe in libcurl v8.7.1 itself. Strangely though, version API returns 8.7.1 as 8.7.0-DEV implying that it is not stable.
The text was updated successfully, but these errors were encountered:
Thanks for the detailed report. I'll verify the behavior later.
As for the version API, I noticed it a while ago. I did use the v8.7.1 tag from curl repository, you can take a look at the Makefiles, however, the compiled binary does not show this version. There might be something wrong with the build arguments or something like that.
Problem
libcurl provides a
WRITEFUNCTION
option to process response chunks. Its behavior is to abort the download if returned integer is not equal to the length of passed chunk.It looks like instead of
E_WRITE_ERROR
, latestlibcurl-impersonate
is returningE_RECV_ERROR
which breaks the abort functionality and makes it impossible to differentiate between server side receive errors/timeouts and on-purpose aborts.Test Case
Following is the minimal test case with
pycurl
that can be used to reproduce this:Results
Use
LD_PRELOAD
to loadlibcurl-impersonate 0.8.0
and run the test. Error56 (E_RECV_ERROR)
will return:I tried the same test case with
libcurl-impersonate 0.7.0b1
built with olderlibcurl v8.5
and it passed:Error
23 (E_WRITE_ERROR)
is the expected code, which allows client to handle on-purpose aborts and process the result. Something got broken in latest impersonation patch or maybe in libcurl v8.7.1 itself. Strangely though, version API returns 8.7.1 as8.7.0-DEV
implying that it is not stable.The text was updated successfully, but these errors were encountered: