+7 December 2007: Wouter
+ - unbound-host has a -d option to show what happens. This can help
+ with debugging (why do I get this answer).
+
6 December 2007: Wouter
- library resolution works in foreground mode, unbound-host app
receives data.
return UB_NOERROR;
}
+int
+ub_val_ctx_debuglevel(struct ub_val_ctx* ctx, int d)
+{
+ lock_basic_lock(&ctx->cfglock);
+ verbosity = d;
+ ctx->env->cfg->verbosity = d;
+ lock_basic_unlock(&ctx->cfglock);
+ return UB_NOERROR;
+}
+
int
ub_val_ctx_async(struct ub_val_ctx* ctx, int dothread)
{
*/
int ub_val_ctx_trustedkeys(struct ub_val_ctx* ctx, char* fname);
+/**
+ * Set debug verbosity for the context
+ * Output is directed to stderr.
+ * @param ctx: context.
+ * @param d: debug level, 0 is off, 1 is very minimal, 2 is detailed,
+ * and 3 is lots.
+ * @return 0 if OK, else error.
+ */
+int ub_val_ctx_debuglevel(struct ub_val_ctx* ctx, int d);
+
/**
* Set a context behaviour for asynchronous action.
* @param ctx: context.
printf(" -f keyfile read trust anchors from file, with lines as -y.\n");
printf(" -F keyfile read named.conf-style trust anchors.\n");
printf(" -v be more verbose, shows nodata and security.\n");
+ printf(" -d debug, traces the action, -d -d shows more.\n");
printf(" -h show this usage help.\n");
printf("Version %s\n", PACKAGE_VERSION);
printf("BSD licensed, see LICENSE in source package for details.\n");
char* qclass = NULL;
char* qtype = NULL;
struct ub_val_ctx* ctx = NULL;
+ int debuglevel = 0;
ctx = ub_val_ctx_create();
if(!ctx) {
}
/* parse the options */
- while( (c=getopt(argc, argv, "F:c:f:ht:vy:")) != -1) {
+ while( (c=getopt(argc, argv, "F:c:df:ht:vy:")) != -1) {
switch(c) {
case 'c':
qclass = optarg;
break;
+ case 'd':
+ debuglevel++;
+ if(debuglevel < 2)
+ debuglevel = 2; /* at least VERB_DETAIL */
+ ub_val_ctx_debuglevel(ctx, debuglevel);
+ break;
case 't':
qtype = optarg;
break;