send_ok(ssl);
}
+/** print root forwards */
+static int
+print_root_fwds(SSL* ssl, struct config_file* cfg)
+{
+ struct config_stub* s;
+ if(!ssl_printf(ssl, "root-forward:"))
+ return 0;
+ for(s = cfg->forwards; s; s = s->next) {
+ if(s->name && strcmp(s->name, ".") == 0) {
+ struct config_strlist* p;
+ for(p = s->hosts; p; p = p->next)
+ if(!ssl_printf(ssl, " %s", p->str))
+ return 0;
+ for(p = s->addrs; p; p = p->next)
+ if(!ssl_printf(ssl, " %s", p->str))
+ return 0;
+ return ssl_printf(ssl, "\n");
+ }
+ }
+ return ssl_printf(ssl, " no (using root hints)\n");
+}
+
/** do the status command */
static void
do_status(SSL* ssl, struct worker* worker)
}
if(!ssl_printf(ssl, " ]\n"))
return;
+ if(!print_root_fwds(ssl, worker->env.cfg))
+ return;
uptime = (time_t)time(NULL) - (time_t)worker->daemon->time_boot.tv_sec;
if(!ssl_printf(ssl, "uptime: %u seconds\n", (unsigned)uptime))
return;
- stats_noreset feature for unbound-control.
- flush_requestlist feature for unbound-control.
- libunbound version upped API (was changed 5 feb).
+ - unbound-control status shows if root forwarding is in use.
+ - slightly nicer memory management in iter-fwd code.
10 February 2009: Wouter
- keys with rfc5011 REVOKE flag are skipped and not considered when
forwards_apply_cfg(struct iter_forwards* fwd, struct config_file* cfg)
{
free(fwd->tree);
+ regional_free_all(fwd->region);
fwd->tree = rbtree_create(fwd_cmp);
if(!fwd->tree)
return 0;
{
if(!fwd)
return 0;
- return sizeof(*fwd) + regional_get_mem(fwd->region);
+ return sizeof(*fwd) + sizeof(*fwd->tree) +
+ regional_get_mem(fwd->region);
}