public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
From: Noah Sanci <nsanci@redhat.com>
To: elfutils-devel@sourceware.org
Subject: debuginfod: Query debuginfod servers before printing response
Date: Fri, 17 Sep 2021 10:55:02 -0400	[thread overview]
Message-ID: <CAJXA7qgr7uafdVKN+ArV6CvFqU41hu9PsFfA9kzgQ=K9+hZ+xw@mail.gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 483 bytes --]

Hello,

While checking PR27277 on some buildbots, greping would fail in
run-debuginfod-response-headers.sh. This was because querying the
debuginfod server occurs after checking if the response headers had
arrived, leaving the possibility to leave the querying loop before
outputting the headers which caused the grep failure. Querying now
occurs before checking if response headers have arrived, so that they
will certainly be printed and grep will find them.

Regards,

Noah Sanci

[-- Attachment #2: 0001-debuginfod-Query-debuginfod-servers-before-printing-.patch --]
[-- Type: text/x-patch, Size: 2086 bytes --]

From 8626a4786c1e79e1b4891ea31966bc124e029378 Mon Sep 17 00:00:00 2001
From: Noah Sanci <nsanci@redhat.com>
Date: Fri, 17 Sep 2021 10:45:39 -0400
Subject: [PATCH] debuginfod: Query debuginfod servers before printing response

While checking PR27277 on some buildbots, greping would fail in
run-debuginfod-response-headers.sh. This was because querying the
debuginfod server occurs after checking if the responseh headers had
arrived, leaving the possibility to leave the querying loop before
outputting the headers which caused the grep failure. Querying now
occurs before checking if response headers have arrived, so that they
will certainly be printed and grep will find them.

Signed-off-by: Noah Sanci <nsanci@redhat.com>
---
 debuginfod/ChangeLog           | 5 +++++
 debuginfod/debuginfod-client.c | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/debuginfod/ChangeLog b/debuginfod/ChangeLog
index e2e6c5f8..c2bfce98 100644
--- a/debuginfod/ChangeLog
+++ b/debuginfod/ChangeLog
@@ -1,3 +1,8 @@
+2021-09-17  Noah Sanci  <nsanci@redhat.com>
+
+	* debuginfod-client.c (debuginfod_query_server): curl_multi_perform
+	now occurs before checking if response headers have arrived.
+
 2021-09-14  Frank Ch. Eigler <fche@redhat.com>
 
 	PRPR28339
diff --git a/debuginfod/debuginfod-client.c b/debuginfod/debuginfod-client.c
index 4d5dbd95..88e45567 100644
--- a/debuginfod/debuginfod-client.c
+++ b/debuginfod/debuginfod-client.c
@@ -1046,6 +1046,7 @@ debuginfod_query_server (debuginfod_client *c,
         }
       /* Wait 1 second, the minimum DEBUGINFOD_TIMEOUT.  */
       curl_multi_wait(curlm, NULL, 0, 1000, NULL);
+      CURLMcode curlm_res = curl_multi_perform(curlm, &still_running);
 
       /* If the target file has been found, abort the other queries.  */
       if (target_handle != NULL)
@@ -1077,7 +1078,6 @@ debuginfod_query_server (debuginfod_client *c,
 	  verbose_reported = true;
 	}
 
-      CURLMcode curlm_res = curl_multi_perform(curlm, &still_running);
       if (curlm_res != CURLM_OK)
         {
           switch (curlm_res)
-- 
2.31.1


             reply	other threads:[~2021-09-17 14:55 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-17 14:55 Noah Sanci [this message]
2021-09-17 15:06 ` Mark Wielaard
2021-09-17 17:38   ` Noah Sanci
2021-09-17 17:49     ` Mark Wielaard

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='CAJXA7qgr7uafdVKN+ArV6CvFqU41hu9PsFfA9kzgQ=K9+hZ+xw@mail.gmail.com' \
    --to=nsanci@redhat.com \
    --cc=elfutils-devel@sourceware.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).