When I create a libcurl handle, and give it CURLOPT_PROGRESSFUNCTION callback that always returns 1, curl_easy_perform returns CURLE_GOT_NOTHING.
Expected outcome: curl_easy_perform returns CURLE_ABORTED_BY_CALLBACK.
I first observed on curl-7.33.0 on amd64 Gentoo, then tried to reproduce with libcurl compiled from git sources. I have also tried latest master (030303fa999d1457b7cd24efab8dfcb5dec54333), which returns the wrong code as well.
It looks like the first problematic commit is 4ad8e142da463ab208d5b5565e53291c8e5ef038, which is one of the first commits after 7.32.0 release. Its immediate parent (e3ee73b70ceaf2663fc2d26a4102e131a7c9618d) seems to work fine.
Attaching a client program that reproduces the issue for me.
Steps to reproduce:
1. checkout given curl version
2. ./buildconf && ./configure --without-axtls --without-cyassl --without-gnutls --without-nss --without-polarssl -with-ssl --without-ca-bundle --with-ca-path=/etc/ssl/certs --enable-dict --enable-file --enable-ftp --enable-http --without-spnego --without-winidn --without-winssl --with-zlib --disable-versioned-symbols --without-darwinssl --without-krb4 && make
(then, somewhere else)
3. gcc -o testAbort -lcurl testAbort.c
4. LD_LIBARY_PATH=${CURL_CHECKOUT}/lib/.libs ./testAbort
Wow, that is fast first reaction, thank you for that :-)
Note I misspelled LD_LIBRARY_PATH in the last command. Sorry about that. Also, I probably should have explicitly noted that the code run does not touch the network (gets cancelled just after connect() syscall returns EINPROGRESS), so I did not include any testing server.
Right, thanks for the additional notes. I built a version with a static libcurl and it reproduced at once so... I'm right now pondering on what the correct fix is!
Here's my suggested fix that makes your test work for me, and still the test suite runs fine. I hope to convert your example into a test case for the future.
If you give me your full name I'll give you proper credit in the commit!
That patch fixes the issue for me, thank you. My full name is Petr Novak. Thanks again for resolving this so swiftly, and for curl in general!
Thanks for verifying. I've pushed the commit and I'm closing this case now.
I also created test case 1513 based on your recipe, to avoid future regressions on this.