rewrite EBADRESP to EBADQUERY on ares_send

Due to the way record duplication works, we might sometimes get a
misleading error code.  Rewrite the error code to make better
sense.

Authored-By: Brad House (@bradh352)
v1.31
Brad House 2 weeks ago
parent 29384a1d12
commit 67951a9799
  1. 5
      src/lib/ares_send.c

@ -86,6 +86,11 @@ ares_status_t ares_send_nolock(ares_channel_t *channel,
status = ares_dns_write(dnsrec, &query->qbuf, &query->qlen);
if (status != ARES_SUCCESS) {
/* Sometimes we might get a EBADRESP response from duplicate due to
* the way it works (write and parse), rewrite it to EBADQUERY. */
if (status == ARES_EBADRESP) {
status = ARES_EBADQUERY;
}
ares_free(query);
callback(arg, status, 0, NULL);
return status;

Loading…
Cancel
Save