Skip to content

USE_HYPER and CURLE_BAD_FUNCTION_ARGUMENT #8894

Closed
@gvanem

Description

@gvanem

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions