public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
From: Kamil Dudka <kdudka@redhat.com>
To: git-commits@fedoraproject.org
Subject: [rpms/curl] curl-v8.23.0-3: avoid spurious "Could not resolve host: [host name]" error messages
Date: Tue, 03 Nov 2026 12:37:25 GMT	[thread overview]
Message-ID: <179370944511.1.13852608617734475642.rpms-curl-902ddefeb533@fedoraproject.org> (raw)

A new commit has been pushed.

Repo   : rpms/curl
Branch : curl-v8.23.0-3
Commit : 902ddefeb533ae02d3588bb99d78fb178999da22
Author : Kamil Dudka <kdudka@redhat.com>
Date   : 2019-03-21T09:39:30+01:00
Stats  : +126/-1 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/curl/c/902ddefeb533ae02d3588bb99d78fb178999da22?branch=curl-v8.23.0-3

Log:
avoid spurious "Could not resolve host: [host name]" error messages

---
diff --git a/0004-curl-7.64.0-spurious-resolver-error.patch b/0004-curl-7.64.0-spurious-resolver-error.patch
new file mode 100644
index 0000000..3e05ad5
--- /dev/null
+++ b/0004-curl-7.64.0-spurious-resolver-error.patch
@@ -0,0 +1,118 @@
+From 5ddabe85b2e3e4fd08d06980719d71a2aed77a5b Mon Sep 17 00:00:00 2001
+From: Daniel Stenberg <daniel@haxx.se>
+Date: Thu, 28 Feb 2019 20:34:36 +0100
+Subject: [PATCH] threaded-resolver: shutdown the resolver thread without error
+ message
+
+When a transfer is done, the resolver thread will be brought down. That
+could accidentally generate an error message in the error buffer even
+though this is not an error situationand the transfer would still return
+OK.  An application that still reads the error buffer could find a
+"Could not resolve host: [host name]" message there and get confused.
+
+Reported-by: Michael Schmid
+Fixes #3629
+Closes #3630
+
+Upstream-commit: 754ae103989a6ad0869d23a6a427d652b5b4a2fe
+Signed-off-by: Kamil Dudka <kdudka@redhat.com>
+---
+ lib/asyn-thread.c | 68 ++++++++++++++++++++++++++---------------------
+ 1 file changed, 38 insertions(+), 30 deletions(-)
+
+diff --git a/lib/asyn-thread.c b/lib/asyn-thread.c
+index a9679d0..55e0811 100644
+--- a/lib/asyn-thread.c
++++ b/lib/asyn-thread.c
+@@ -461,6 +461,42 @@ static CURLcode resolver_error(struct connectdata *conn)
+   return result;
+ }
+ 
++static CURLcode thread_wait_resolv(struct connectdata *conn,
++                                   struct Curl_dns_entry **entry,
++                                   bool report)
++{
++  struct thread_data   *td = (struct thread_data*) conn->async.os_specific;
++  CURLcode result = CURLE_OK;
++
++  DEBUGASSERT(conn && td);
++  DEBUGASSERT(td->thread_hnd != curl_thread_t_null);
++
++  /* wait for the thread to resolve the name */
++  if(Curl_thread_join(&td->thread_hnd)) {
++    if(entry)
++      result = getaddrinfo_complete(conn);
++  }
++  else
++    DEBUGASSERT(0);
++
++  conn->async.done = TRUE;
++
++  if(entry)
++    *entry = conn->async.dns;
++
++  if(!conn->async.dns && report)
++    /* a name was not resolved, report error */
++    result = resolver_error(conn);
++
++  destroy_async_data(&conn->async);
++
++  if(!conn->async.dns && report)
++    connclose(conn, "asynch resolve failed");
++
++  return result;
++}
++
++
+ /*
+  * Until we gain a way to signal the resolver threads to stop early, we must
+  * simply wait for them and ignore their results.
+@@ -473,7 +509,7 @@ void Curl_resolver_kill(struct connectdata *conn)
+      unfortunately.  Otherwise, we can simply cancel to clean up any resolver
+      data. */
+   if(td && td->thread_hnd != curl_thread_t_null)
+-    (void)Curl_resolver_wait_resolv(conn, NULL);
++    (void)thread_wait_resolv(conn, NULL, FALSE);
+   else
+     Curl_resolver_cancel(conn);
+ }
+@@ -494,35 +530,7 @@ void Curl_resolver_kill(struct connectdata *conn)
+ CURLcode Curl_resolver_wait_resolv(struct connectdata *conn,
+                                    struct Curl_dns_entry **entry)
+ {
+-  struct thread_data   *td = (struct thread_data*) conn->async.os_specific;
+-  CURLcode result = CURLE_OK;
+-
+-  DEBUGASSERT(conn && td);
+-  DEBUGASSERT(td->thread_hnd != curl_thread_t_null);
+-
+-  /* wait for the thread to resolve the name */
+-  if(Curl_thread_join(&td->thread_hnd)) {
+-    if(entry)
+-      result = getaddrinfo_complete(conn);
+-  }
+-  else
+-    DEBUGASSERT(0);
+-
+-  conn->async.done = TRUE;
+-
+-  if(entry)
+-    *entry = conn->async.dns;
+-
+-  if(!conn->async.dns)
+-    /* a name was not resolved, report error */
+-    result = resolver_error(conn);
+-
+-  destroy_async_data(&conn->async);
+-
+-  if(!conn->async.dns)
+-    connclose(conn, "asynch resolve failed");
+-
+-  return result;
++  return thread_wait_resolv(conn, entry, TRUE);
+ }
+ 
+ /*
+-- 
+2.17.2
+

diff --git a/curl.spec b/curl.spec
index a8292a6..bed6823 100644
--- a/curl.spec
+++ b/curl.spec
@@ -1,7 +1,7 @@
 Summary: A utility for getting files from remote servers (FTP, HTTP, and others)
 Name: curl
 Version: 7.64.0
-Release: 4%{?dist}
+Release: 5%{?dist}
 License: MIT
 Source: https://curl.haxx.se/download/%{name}-%{version}.tar.xz
 
@@ -14,6 +14,9 @@ Patch2:   0002-curl-7.64.0-nm-fd-leak.patch
 # fix NULL dereference if flushing cookies with no CookieInfo set (#1683676)
 Patch3:   0003-curl-7.64.0-cookie-segfault.patch
 
+# avoid spurious "Could not resolve host: [host name]" error messages
+Patch4:   0004-curl-7.64.0-spurious-resolver-error.patch
+
 # patch making libcurl multilib ready
 Patch101: 0101-curl-7.32.0-multilib.patch
 
@@ -178,6 +181,7 @@ be installed.
 %patch1 -p1
 %patch2 -p1
 %patch3 -p1
+%patch4 -p1
 
 # Fedora patches
 %patch101 -p1
@@ -345,6 +349,9 @@ rm -f ${RPM_BUILD_ROOT}%{_libdir}/libcurl.la
 %{_libdir}/libcurl.so.4.[0-9].[0-9].minimal
 
 %changelog
+* Wed Mar 21 2019 Kamil Dudka <kdudka@redhat.com> - 7.64.0-5
+- avoid spurious "Could not resolve host: [host name]" error messages
+
 * Wed Feb 27 2019 Kamil Dudka <kdudka@redhat.com> - 7.64.0-4
 - fix NULL dereference if flushing cookies with no CookieInfo set (#1683676)
 

                 reply	other threads:[~2026-11-03 12:37 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=179370944511.1.13852608617734475642.rpms-curl-902ddefeb533@fedoraproject.org \
    --to=kdudka@redhat.com \
    --cc=git-commits@fedoraproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox