]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
doh: Inherit CURLOPT_STDERR from user's easy handle
authorJay Satiro <raysatiro@yahoo.com>
Thu, 25 Feb 2021 20:49:00 +0000 (15:49 -0500)
committerJay Satiro <raysatiro@yahoo.com>
Tue, 2 Mar 2021 21:59:28 +0000 (16:59 -0500)
Prior to this change if the user set their easy handle's error stream
to something other than stderr it was not inherited by the doh handles,
which meant that they would still write to the default standard error
stream (stderr) for verbose output.

Bug: https://github.com/curl/curl/issues/6605
Reported-by: arvids-kokins-bidstack@users.noreply.github.com
Closes https://github.com/curl/curl/pull/6661

lib/doh.c

index dcc1f6da68e6c662595667b5165af5c01094c326..15cdc35a46949fc92629e04b6130d82c4836c20a 100644 (file)
--- a/lib/doh.c
+++ b/lib/doh.c
@@ -285,6 +285,8 @@ static CURLcode dohprobe(struct Curl_easy *data,
 #endif
     ERROR_CHECK_SETOPT(CURLOPT_TIMEOUT_MS, (long)timeout_ms);
     ERROR_CHECK_SETOPT(CURLOPT_SHARE, data->share);
+    if(data->set.err && data->set.err != stderr)
+      ERROR_CHECK_SETOPT(CURLOPT_STDERR, data->set.err);
     if(data->set.verbose)
       ERROR_CHECK_SETOPT(CURLOPT_VERBOSE, 1L);
     if(data->set.no_signal)