]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
url: Include the failure reason when curl_win32_idn_to_ascii() fails
authorSteve Holme <steve_holme@hotmail.com>
Sun, 9 Feb 2020 04:37:52 +0000 (04:37 +0000)
committerSteve Holme <steve_holme@hotmail.com>
Sun, 9 Feb 2020 11:38:54 +0000 (11:38 +0000)
Provide the failure reason in the failf() info just as we do for the
libidn2 version of code.

Closes #4899

lib/url.c

index 07d429e35e7e2a31bfaf3d5e32f510bfdbe7f4b9..f3b26dafaee110fe8b7a55d32d0d640777e6d8d8 100644 (file)
--- a/lib/url.c
+++ b/lib/url.c
@@ -1514,7 +1514,9 @@ static CURLcode idnconvert_hostname(struct connectdata *conn,
       host->name = host->encalloc;
     }
     else {
-      failf(data, "Failed to convert %s to ACE;\n", host->name);
+      char buffer[STRERROR_LEN];
+      failf(data, "Failed to convert %s to ACE; %s\n", host->name,
+            Curl_winapi_strerror(GetLastError(), buffer, sizeof(buffer)));
       return CURLE_URL_MALFORMAT;
     }
 #else