Closed
Description
Building libcurl with -DUSE_HYPER
always causes the annoying error:
curl: (43) A libcurl function was given a bad argument
on any address.
I'm building with the most up-to date version of Hyper.dll.lib
on Win-10.
Now, a simple curl.exe -vL4 www.curl.se
, just gives this:
...
* STATE: DO => DID handle 0x10011228; line 2145 (connection #0)
* STATE: DID => PERFORMING handle 0x10011228; line 2264 (connection #0)
* HTTP 1.1 or later with persistent connection
< HTTP/1.1 301 Moved Permanently
* multi_done: status: 43 prem: 1 done: 0
* Curl_quic_done
* The cache now contains 0 members
* Closing connection 0
* Expire cleared (transfer 0x10011228)
curl: (43) A libcurl function was given a bad argument
So it would be nice if in verbose-mode (-v
) libcurl could state at which point that is happening.
Perhaps only with -DCURLDEBUG
. I was thinking of adding something like this to memdebug.h
:
static int inline curl_dbg_bad_function_argument (int verbose, const char *file, unsigned line)
{
if (verbose)
fprintf(stderr, "%s(%u): Throwing a 'CURLE_BAD_FUNCTION_ARGUMENT'\n", file, line);
return (CURLE_BAD_FUNCTION_ARGUMENT);
}
#define curl_dbg_BAD_FUNCTION_ARGUMENT(verb) curl_dbg_bad_function_argument (verb, __FILE__, __LINE__)
...
#ifndef curl_dbg_BAD_FUNCTION_ARGUMENT
#define curl_dbg_BAD_FUNCTION_ARGUMENT(verb) CURLE_BAD_FUNCTION_ARGUMENT
#endif
And using this every place where a data->set.verbose
is present.