mirror of
https://github.com/curl/curl.git
synced 2026-07-26 02:37:16 +03:00
urlapi: add curl_url_strerror()
Add curl_url_strerror() to convert CURLUcode into readable string and facilitate easier troubleshooting in programs using URL API. Extend CURLUcode with CURLU_LAST for iteration in unit tests. Update man pages with a mention of new function. Update example code and tests with new functionality where it fits. Closes #7605
This commit is contained in:
parent
f0b8d1c5f6
commit
3363eeb262
25 changed files with 233 additions and 72 deletions
|
|
@ -5,7 +5,7 @@
|
|||
* | (__| |_| | _ <| |___
|
||||
* \___|\___/|_| \_\_____|
|
||||
*
|
||||
* Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
* Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al.
|
||||
*
|
||||
* This software is licensed as described in the file COPYING, which
|
||||
* you should have received as part of this distribution. The terms
|
||||
|
|
@ -26,8 +26,8 @@
|
|||
#include <stdio.h>
|
||||
#include <curl/curl.h>
|
||||
|
||||
#if !CURL_AT_LEAST_VERSION(7, 62, 0)
|
||||
#error "this example requires curl 7.62.0 or later"
|
||||
#if !CURL_AT_LEAST_VERSION(7, 80, 0)
|
||||
#error "this example requires curl 7.80.0 or later"
|
||||
#endif
|
||||
|
||||
int main(void)
|
||||
|
|
@ -47,7 +47,7 @@ int main(void)
|
|||
"http://example.com/path/index.html", 0);
|
||||
|
||||
if(uc) {
|
||||
fprintf(stderr, "curl_url_set() failed: %in", uc);
|
||||
fprintf(stderr, "curl_url_set() failed: %s", curl_url_strerror(uc));
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue