public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
* [PATCH] Cygwin: resolver: cygwin_query() skip response header on internal error
@ 2022-01-19 13:12 Anton Lavrentiev
  2022-01-19 14:32 ` Corinna Vinschen
  0 siblings, 1 reply; 2+ messages in thread
From: Anton Lavrentiev @ 2022-01-19 13:12 UTC (permalink / raw)
  To: cygwin-patches

- When dn_comp() failed internally there is no longer any need to
fill the response header since it's now all cleared upon entry
---
 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);
-- 
2.33.0


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Cygwin: resolver: cygwin_query() skip response header on internal error
  2022-01-19 13:12 [PATCH] Cygwin: resolver: cygwin_query() skip response header on internal error Anton Lavrentiev
@ 2022-01-19 14:32 ` Corinna Vinschen
  0 siblings, 0 replies; 2+ messages in thread
From: Corinna Vinschen @ 2022-01-19 14:32 UTC (permalink / raw)
  To: cygwin-patches

On Jan 19 08:12, Anton Lavrentiev via Cygwin-patches wrote:
> - When dn_comp() failed internally there is no longer any need to
> fill the response header since it's now all cleared upon entry
> ---
>  winsup/cygwin/libc/minires-os-if.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)

Pushed.

Thanks,
Corinna

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-01-19 14:32 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-19 13:12 [PATCH] Cygwin: resolver: cygwin_query() skip response header on internal error Anton Lavrentiev
2022-01-19 14:32 ` Corinna Vinschen

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).