public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: resolver: cygwin_query() skip response header on internal error
Date: Wed, 19 Jan 2022 14:31:48 +0000 (GMT)	[thread overview]
Message-ID: <20220119143148.1BA083857C7E@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=93511d575ed3a838cd4943a4e24c787d5a0c679d

commit 93511d575ed3a838cd4943a4e24c787d5a0c679d
Author: Anton Lavrentiev via Cygwin-patches <cygwin-patches@cygwin.com>
Date:   Wed Jan 19 08:12:55 2022 -0500

    Cygwin: resolver: cygwin_query() skip response header on internal error
    
    - When dn_comp() failed internally there is no longer any need to
    fill the response header since it's now all cleared upon entry

Diff:
---
 winsup/cygwin/libc/minires-os-if.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/libc/minires-os-if.c b/winsup/cygwin/libc/minires-os-if.c
index c6fde776a..4e8e9cf21 100644
--- a/winsup/cygwin/libc/minires-os-if.c
+++ b/winsup/cygwin/libc/minires-os-if.c
@@ -266,6 +266,7 @@ static int cygwin_query(res_state statp, const char * DomName, int Class, int Ty
       if ((len = dn_comp(rr->pName, ptr, AnsLength - 4,
 			 dnptrs, &dnptrs[DIM(dnptrs) - 1])) < 0) {
 	statp->res_h_errno = NETDB_INTERNAL;  /* dn_comp sets errno */
+	AnsLength = 0;
 	len = -1;
 	goto done;
       }
@@ -283,7 +284,7 @@ static int cygwin_query(res_state statp, const char * DomName, int Class, int Ty
       DPRINTF(debug, "Unexpected section order for \"%s\" %d\n", DomName, Type);
       continue;
     }
-    section =  rr->Flags.DW & 0x3;
+    section = rr->Flags.DW & 0x3;
 
     ptr = write_record(ptr, rr, AnsPtr + AnsLength, dnptrs,
 		       &dnptrs[DIM(dnptrs) - 1], debug);


                 reply	other threads:[~2022-01-19 14:31 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=20220119143148.1BA083857C7E@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@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).