Commit 0d1957df authored by Per Cederqvist's avatar Per Cederqvist
Browse files

(oop_adns_submit): New argument: errcode.

(oop_adns_submit_reverse): New function.
parent 6beb6831
......@@ -11,6 +11,7 @@
#include "oop-adns.h"
#include <assert.h>
#include <stdlib.h>
#ifdef HAVE_STRING_H
# include <string.h> /* Needed on NetBSD1.1/SPARC due to bzero/FD_ZERO. */
......@@ -70,13 +71,33 @@ void oop_adns_delete(oop_adapter_adns *a) {
}
oop_adns_query *oop_adns_submit(
oop_adapter_adns *a,
oop_adapter_adns *a,int *errcode,
const char *owner,adns_rrtype type,adns_queryflags flags,
oop_adns_call *call,void *data)
{
oop_adns_query *q = oop_malloc(sizeof(*q));
if (NULL == q) return NULL;
if (adns_submit(a->state,owner,type,flags,q,&q->query)) {
if (0 != (*errcode = adns_submit(a->state,owner,type,flags,q,&q->query))) {
oop_free(q);
return NULL;
}
q->a = a;
q->call = call;
q->data = data;
++q->a->count;
set_select(a);
return q;
}
oop_adns_query *oop_adns_submit_reverse(
oop_adapter_adns *a,int *errcode,
const struct sockaddr *addr,adns_rrtype type,adns_queryflags flags,
oop_adns_call *call,void *data)
{
oop_adns_query *q = oop_malloc(sizeof(*q));
if (NULL == q) return NULL;
if (0 != (*errcode = adns_submit_reverse(a->state,addr,type,flags,q,&q->query))) {
oop_free(q);
return NULL;
}
......
......@@ -26,10 +26,15 @@ void oop_adns_delete(oop_adapter_adns *);
The returned pointer is valid until the callback occurs or the
query is cancelled (see below). */
oop_adns_query *oop_adns_submit(
oop_adapter_adns *,
oop_adapter_adns *,int *errcode,
const char *owner,adns_rrtype type,adns_queryflags flags,
oop_adns_call *,void *);
oop_adns_query *oop_adns_submit_reverse(
oop_adapter_adns *,int *errcode,
const struct sockaddr *addr,adns_rrtype type,adns_queryflags flags,
oop_adns_call *,void *);
/* Cancel a running query. */
void oop_adns_cancel(oop_adns_query *);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment