Skip to content

Instantly share code, notes, and snippets.

@jgajek
Created March 28, 2016 16:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jgajek/6028343f0cf90d0a6bc3 to your computer and use it in GitHub Desktop.
Save jgajek/6028343f0cf90d0a6bc3 to your computer and use it in GitHub Desktop.
if (n == 0) {
Dprint(statp->options & RES_DEBUG, (stdout, ";; timeout\n"));
if (resplen > 1 && (recvresp1 || (buf2 != NULL && recvresp2)))
{
/* There are quite a few broken name servers out
there which don't handle two outstanding
requests from the same source. There are also
broken firewall settings. If we time out after
having received one answer switch to the mode
where we send the second request only once we
have received the first answer. */
if (!single_request)
{
statp->options |= RES_SNGLKUP;
single_request = true;
*gotsomewhere = save_gotsomewhere;
goto retry;
}
else if (!single_request_reopen)
{
statp->options |= RES_SNGLKUPREOP;
single_request_reopen = true;
*gotsomewhere = save_gotsomewhere;
__res_iclose (statp, false);
goto retry_reopen;
}
*resplen2 = 1;
return resplen;
}
*gotsomewhere = 1;
return (0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment