2
0
mirror of https://gitlab.isc.org/isc-projects/bind9 synced 2025-08-31 14:35:26 +00:00

842. [func] 'rndc flush' now takes an optional view.

This commit is contained in:
Brian Wellington
2001-05-31 01:21:12 +00:00
parent b804d77ad9
commit 5455f30a75
5 changed files with 28 additions and 9 deletions

View File

@@ -1,3 +1,5 @@
842. [func] 'rndc flush' now takes an optional view.
841. [bug] When sdb modules were not declared threadsafe, their 841. [bug] When sdb modules were not declared threadsafe, their
create and destroy functions were not serialized. create and destroy functions were not serialized.

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: control.c,v 1.6 2001/05/08 04:09:36 bwelling Exp $ */ /* $Id: control.c,v 1.7 2001/05/31 01:21:06 bwelling Exp $ */
#include <config.h> #include <config.h>
@@ -107,7 +107,7 @@ ns_control_docommand(isccc_sexpr_t *message, isc_buffer_t *text) {
isc_log_setdebuglevel(ns_g_lctx, ns_g_debuglevel); isc_log_setdebuglevel(ns_g_lctx, ns_g_debuglevel);
result = ISC_R_SUCCESS; result = ISC_R_SUCCESS;
} else if (command_compare(command, NS_COMMAND_FLUSH)) { } else if (command_compare(command, NS_COMMAND_FLUSH)) {
result = ns_server_flushcache(ns_g_server); result = ns_server_flushcache(ns_g_server, command);
} else if (command_compare(command, NS_COMMAND_STATUS)) { } else if (command_compare(command, NS_COMMAND_STATUS)) {
result = ns_server_status(ns_g_server, text); result = ns_server_status(ns_g_server, text);
} else { } else {

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: server.h,v 1.56 2001/05/08 04:09:41 bwelling Exp $ */ /* $Id: server.h,v 1.57 2001/05/31 01:21:09 bwelling Exp $ */
#ifndef NAMED_SERVER_H #ifndef NAMED_SERVER_H
#define NAMED_SERVER_H 1 #define NAMED_SERVER_H 1
@@ -160,7 +160,7 @@ ns_server_setdebuglevel(ns_server_t *server, char *args);
* Flush the server's cache(s) * Flush the server's cache(s)
*/ */
isc_result_t isc_result_t
ns_server_flushcache(ns_server_t *server); ns_server_flushcache(ns_server_t *server, char *args);
/* /*
* Report the server's status. * Report the server's status.

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: server.c,v 1.327 2001/05/28 05:17:00 marka Exp $ */ /* $Id: server.c,v 1.328 2001/05/31 01:21:07 bwelling Exp $ */
#include <config.h> #include <config.h>
@@ -2758,21 +2758,37 @@ ns_server_setdebuglevel(ns_server_t *server, char *args) {
} }
isc_result_t isc_result_t
ns_server_flushcache(ns_server_t *server) { ns_server_flushcache(ns_server_t *server, char *args) {
char *ptr, *viewname;
dns_view_t *view; dns_view_t *view;
isc_boolean_t flushed = ISC_FALSE;
isc_result_t result; isc_result_t result;
/* Skip the command name. */
ptr = next_token(&args, " \t");
if (ptr == NULL)
return (ISC_R_UNEXPECTEDEND);
/* Look for the view name. */
viewname = next_token(&args, " \t");
result = isc_task_beginexclusive(server->task); result = isc_task_beginexclusive(server->task);
RUNTIME_CHECK(result == ISC_R_SUCCESS); RUNTIME_CHECK(result == ISC_R_SUCCESS);
for (view = ISC_LIST_HEAD(server->viewlist); for (view = ISC_LIST_HEAD(server->viewlist);
view != NULL; view != NULL;
view = ISC_LIST_NEXT(view, link)) view = ISC_LIST_NEXT(view, link))
{ {
if (viewname != NULL && strcasecmp(viewname, view->name) != 0)
continue;
result = dns_view_flushcache(view); result = dns_view_flushcache(view);
if (result != ISC_R_SUCCESS) if (result != ISC_R_SUCCESS)
goto out; goto out;
flushed = ISC_TRUE;
} }
result = ISC_R_SUCCESS; if (flushed)
result = ISC_R_SUCCESS;
else
result = ISC_R_FAILURE;
out: out:
isc_task_endexclusive(server->task); isc_task_endexclusive(server->task);
return (result); return (result);

View File

@@ -15,7 +15,7 @@
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/ */
/* $Id: rndc.c,v 1.60 2001/05/22 00:56:01 bwelling Exp $ */ /* $Id: rndc.c,v 1.61 2001/05/31 01:21:10 bwelling Exp $ */
/* /*
* Principal Author: DCL * Principal Author: DCL
@@ -112,7 +112,8 @@ command is one of the following:\n\
trace Increment debugging level by one.\n\ trace Increment debugging level by one.\n\
trace level Change the debugging level.\n\ trace level Change the debugging level.\n\
notrace Set debugging level to 0.\n\ notrace Set debugging level to 0.\n\
flush Flushes the server's cache.\n\ flush Flushes all of the server's caches.\n\
flush [view] Flushes the server's cache for a view.\n\
status Display status of the server.\n\ status Display status of the server.\n\
*restart Restart the server.\n\ *restart Restart the server.\n\
\n\ \n\