mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-20 23:00:56 -05:00
result_free to resolve_free (thanks Benno).
git-svn-id: file:///svn/unbound/trunk@924 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
46f7dc4d08
commit
a9a47f8b41
8 changed files with 15 additions and 14 deletions
|
|
@ -2,6 +2,7 @@
|
||||||
- clearer explanation of threading configure options.
|
- clearer explanation of threading configure options.
|
||||||
- fixup asynclook test for nothreading (it creates only one process
|
- fixup asynclook test for nothreading (it creates only one process
|
||||||
to do the extended test).
|
to do the extended test).
|
||||||
|
- changed name of ub_val_result_free to ub_val_resolve_free.
|
||||||
|
|
||||||
5 February 2008: Wouter
|
5 February 2008: Wouter
|
||||||
- statistics-interval: seconds option added.
|
- statistics-interval: seconds option added.
|
||||||
|
|
|
||||||
|
|
@ -31,7 +31,7 @@
|
||||||
.B ub_val_resolve,
|
.B ub_val_resolve,
|
||||||
.B ub_val_resolve_async,
|
.B ub_val_resolve_async,
|
||||||
.B ub_val_cancel,
|
.B ub_val_cancel,
|
||||||
.B ub_val_result_free,
|
.B ub_val_resolve_free,
|
||||||
.B ub_val_strerror
|
.B ub_val_strerror
|
||||||
\- Unbound DNS validating resolver @version@ functions.
|
\- Unbound DNS validating resolver @version@ functions.
|
||||||
.SH "SYNOPSIS"
|
.SH "SYNOPSIS"
|
||||||
|
|
@ -102,7 +102,7 @@
|
||||||
\fBub_val_cancel\fR(\fIstruct ub_val_ctx*\fR ctx, \fIint\fR async_id);
|
\fBub_val_cancel\fR(\fIstruct ub_val_ctx*\fR ctx, \fIint\fR async_id);
|
||||||
.LP
|
.LP
|
||||||
\fIvoid\fR
|
\fIvoid\fR
|
||||||
\fBub_val_result_free\fR(\fIstruct ub_val_result*\fR result);
|
\fBub_val_resolve_free\fR(\fIstruct ub_val_result*\fR result);
|
||||||
.LP
|
.LP
|
||||||
\fIconst char *\fR
|
\fIconst char *\fR
|
||||||
\fBub_val_strerror\fR(\fIint\fR err);
|
\fBub_val_strerror\fR(\fIint\fR err);
|
||||||
|
|
@ -251,7 +251,7 @@ and cancel the request if needed.
|
||||||
.B ub_val_cancel
|
.B ub_val_cancel
|
||||||
Cancel an async query in progress.
|
Cancel an async query in progress.
|
||||||
.TP
|
.TP
|
||||||
.B ub_val_result_free
|
.B ub_val_resolve_free
|
||||||
Free struct ub_val_result contents after use.
|
Free struct ub_val_result contents after use.
|
||||||
.TP
|
.TP
|
||||||
.B ub_val_strerror
|
.B ub_val_strerror
|
||||||
|
|
|
||||||
|
|
@ -99,7 +99,7 @@ void
|
||||||
context_query_delete(struct ctx_query* q)
|
context_query_delete(struct ctx_query* q)
|
||||||
{
|
{
|
||||||
if(!q) return;
|
if(!q) return;
|
||||||
ub_val_result_free(q->res);
|
ub_val_resolve_free(q->res);
|
||||||
free(q->msg);
|
free(q->msg);
|
||||||
free(q);
|
free(q);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,5 +15,5 @@ ub_val_process
|
||||||
ub_val_resolve
|
ub_val_resolve
|
||||||
ub_val_resolve_async
|
ub_val_resolve_async
|
||||||
ub_val_cancel
|
ub_val_cancel
|
||||||
ub_val_result_free
|
ub_val_resolve_free
|
||||||
ub_val_strerror
|
ub_val_strerror
|
||||||
|
|
|
||||||
|
|
@ -397,7 +397,7 @@ process_answer_detail(struct ub_val_ctx* ctx, uint8_t* msg, uint32_t len,
|
||||||
}
|
}
|
||||||
if(*err) {
|
if(*err) {
|
||||||
*res = NULL;
|
*res = NULL;
|
||||||
ub_val_result_free(q->res);
|
ub_val_resolve_free(q->res);
|
||||||
} else {
|
} else {
|
||||||
/* parse the message, extract rcode, fill result */
|
/* parse the message, extract rcode, fill result */
|
||||||
ldns_buffer* buf = ldns_buffer_new(q->msg_len);
|
ldns_buffer* buf = ldns_buffer_new(q->msg_len);
|
||||||
|
|
@ -668,7 +668,7 @@ ub_val_cancel(struct ub_val_ctx* ctx, int async_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ub_val_result_free(struct ub_val_result* result)
|
ub_val_resolve_free(struct ub_val_result* result)
|
||||||
{
|
{
|
||||||
char** p;
|
char** p;
|
||||||
if(!result) return;
|
if(!result) return;
|
||||||
|
|
|
||||||
|
|
@ -105,7 +105,7 @@ struct ub_val_ctx;
|
||||||
/**
|
/**
|
||||||
* The validation and resolution results.
|
* The validation and resolution results.
|
||||||
* Allocated by the resolver, and need to be freed by the application
|
* Allocated by the resolver, and need to be freed by the application
|
||||||
* with ub_val_result_free().
|
* with ub_val_resolve_free().
|
||||||
*/
|
*/
|
||||||
struct ub_val_result {
|
struct ub_val_result {
|
||||||
/** The original question, name text string. */
|
/** The original question, name text string. */
|
||||||
|
|
@ -187,7 +187,7 @@ struct ub_val_result {
|
||||||
* are forthcoming.
|
* are forthcoming.
|
||||||
* struct result: pointer to more detailed result structure.
|
* struct result: pointer to more detailed result structure.
|
||||||
* This structure is allocated on the heap and needs to be
|
* This structure is allocated on the heap and needs to be
|
||||||
* freed with ub_val_result_free(result);
|
* freed with ub_val_resolve_free(result);
|
||||||
*/
|
*/
|
||||||
typedef void (*ub_val_callback_t)(void*, int, struct ub_val_result*);
|
typedef void (*ub_val_callback_t)(void*, int, struct ub_val_result*);
|
||||||
|
|
||||||
|
|
@ -196,7 +196,7 @@ typedef void (*ub_val_callback_t)(void*, int, struct ub_val_result*);
|
||||||
* @return a new context. default initialisation.
|
* @return a new context. default initialisation.
|
||||||
* returns NULL on error.
|
* returns NULL on error.
|
||||||
*/
|
*/
|
||||||
struct ub_val_ctx* ub_val_ctx_create();
|
struct ub_val_ctx* ub_val_ctx_create(void);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Destroy a validation context and free all its resources.
|
* Destroy a validation context and free all its resources.
|
||||||
|
|
@ -409,7 +409,7 @@ int ub_val_cancel(struct ub_val_ctx* ctx, int async_id);
|
||||||
* Free storage associated with a result structure.
|
* Free storage associated with a result structure.
|
||||||
* @param result: to free
|
* @param result: to free
|
||||||
*/
|
*/
|
||||||
void ub_val_result_free(struct ub_val_result* result);
|
void ub_val_resolve_free(struct ub_val_result* result);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Convert error value to a human readable string.
|
* Convert error value to a human readable string.
|
||||||
|
|
|
||||||
|
|
@ -349,7 +349,7 @@ dnslook(struct ub_val_ctx* ctx, char* q, int t, int c, int docname)
|
||||||
}
|
}
|
||||||
pretty_output(q, t, c, result, docname);
|
pretty_output(q, t, c, result, docname);
|
||||||
ret = result->nxdomain;
|
ret = result->nxdomain;
|
||||||
ub_val_result_free(result);
|
ub_val_resolve_free(result);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -243,7 +243,7 @@ ext_callback(void* mydata, int err, struct ub_val_result* result)
|
||||||
pi.err = 0;
|
pi.err = 0;
|
||||||
print_result(&pi);
|
print_result(&pi);
|
||||||
}
|
}
|
||||||
ub_val_result_free(result);
|
ub_val_resolve_free(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** extended thread worker */
|
/** extended thread worker */
|
||||||
|
|
@ -451,7 +451,7 @@ int main(int argc, char** argv)
|
||||||
/* print lookup results */
|
/* print lookup results */
|
||||||
for(i=0; i<argc; i++) {
|
for(i=0; i<argc; i++) {
|
||||||
print_result(&lookups[i]);
|
print_result(&lookups[i]);
|
||||||
ub_val_result_free(lookups[i].result);
|
ub_val_resolve_free(lookups[i].result);
|
||||||
}
|
}
|
||||||
|
|
||||||
ub_val_ctx_delete(ctx);
|
ub_val_ctx_delete(ctx);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue