1
0
mirror of https://frontier.innolan.net/rainlance/c-ares.git synced 2025-10-05 23:59:35 +00:00

- Phil Blundell added the internal function ares__expand_name_for_response()

that is now used by the ares_parse_*_reply() functions instead of the
  ares_expand_name() simply to easier return ARES_EBADRESP for the cases where
  the name expansion fails as in responses that really isn't expected.
This commit is contained in:
Daniel Stenberg
2009-01-11 13:49:13 +00:00
parent bcb85d35df
commit 8362245c42
8 changed files with 46 additions and 17 deletions

View File

@ -177,3 +177,14 @@ static int name_length(const unsigned char *encoded, const unsigned char *abuf,
*/
return (n) ? n - 1 : n;
}
/* Like ares_expand_name but returns EBADRESP in case of invalid input. */
int ares__expand_name_for_response(const unsigned char *encoded,
const unsigned char *abuf, int alen,
char **s, long *enclen)
{
int status = ares_expand_name(encoded, abuf, alen, s, enclen);
if (status == ARES_EBADNAME)
status = ARES_EBADRESP;
return status;
}