send_ok(ssl);
}
+/** flush requestlist */
+static void
+do_flush_requestlist(SSL* ssl, struct worker* worker)
+{
+ mesh_delete_all(worker->env.mesh);
+ send_ok(ssl);
+}
+
/**
* Local info for deletion functions
*/
return;
} else if(strncmp(p, "flush_stats", 11) == 0) {
/* must always distribute this cmd */
- if(rc)
- distribute_cmd(rc, ssl, cmd);
+ if(rc) distribute_cmd(rc, ssl, cmd);
do_flush_stats(ssl, worker);
return;
+ } else if(strncmp(p, "flush_requestlist", 17) == 0) {
+ /* must always distribute this cmd */
+ if(rc) distribute_cmd(rc, ssl, cmd);
+ do_flush_requestlist(ssl, worker);
+ return;
} else if(strncmp(p, "lookup", 6) == 0) {
do_lookup(ssl, worker, skipwhite(p+6));
return;
- small refactor of stats clearing.
- #227: flush_stats feature for unbound-control.
- stats_noreset feature for unbound-control.
+ - flush_requestlist feature for unbound-control.
10 February 2009: Wouter
- keys with rfc5011 REVOKE flag are skipped and not considered when
.B flush_stats
Reset statistics to zero.
.TP
+.B flush_requestlist
+Drop the queries that are worked on. Stops working on the queries that the
+server is working on now. The cache is unaffected. No reply is sent for
+those queries, probably making those users request again later.
+Useful to make the server restart working on queries with new settings,
+such as a higher verbosity level.
+.TP
.B dump_requestlist
Show what is worked on. Prints all queries that the server is currently
working on. Prints the time that users have been waiting. For internal
free(mesh);
}
+void
+mesh_delete_all(struct mesh_area* mesh)
+{
+ /* free all query states */
+ traverse_postorder(&mesh->all, &mesh_delete_helper, NULL);
+ mesh->stats_dropped += mesh->num_reply_addrs;
+ /* clear mesh area references */
+ rbtree_init(&mesh->run, &mesh_state_compare);
+ rbtree_init(&mesh->all, &mesh_state_compare);
+ mesh->num_reply_addrs = 0;
+ mesh->num_reply_states = 0;
+ mesh->num_detached_states = 0;
+ mesh->num_forever_states = 0;
+ mesh->forever_first = NULL;
+ mesh->forever_last = NULL;
+ mesh->jostle_first = NULL;
+ mesh->jostle_last = NULL;
+}
+
int mesh_make_new_space(struct mesh_area* mesh)
{
struct mesh_state* m = mesh->jostle_last;
*/
void mesh_state_cleanup(struct mesh_state* mstate);
+/**
+ * Delete all mesh states from the mesh.
+ * @param mesh: the mesh area to clear
+ */
+void mesh_delete_all(struct mesh_area* mesh);
+
/**
* Find a mesh state in the mesh area. Pass relevant flags.
*
printf(" start start server; runs unbound(8)\n");
printf(" stop stops the server\n");
printf(" reload reloads the server\n");
+ printf(" (this flushes data, stats, requestlist)\n");
printf(" stats print statistics\n");
printf(" stats_noreset peek at statistics\n");
printf(" status display status of server\n");
printf(" flush_zone [name] flush everything at or under name\n");
printf(" from rr and dnssec caches\n");
printf(" flush_stats flush statistics, make zero\n");
+ printf(" flush_requestlist drop queries that are worked on\n");
printf(" dump_requestlist show what is worked on\n");
printf("Version %s\n", PACKAGE_VERSION);
printf("BSD licensed, see LICENSE in source package for details.\n");