+ 842. [func] 'rndc flush' now takes an optional view.
+
841. [bug] When sdb modules were not declared threadsafe, their
create and destroy functions were not serialized.
* 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>
isc_log_setdebuglevel(ns_g_lctx, ns_g_debuglevel);
result = ISC_R_SUCCESS;
} 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)) {
result = ns_server_status(ns_g_server, text);
} else {
* 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
#define NAMED_SERVER_H 1
* Flush the server's cache(s)
*/
isc_result_t
-ns_server_flushcache(ns_server_t *server);
+ns_server_flushcache(ns_server_t *server, char *args);
/*
* Report the server's status.
* 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>
}
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;
+ isc_boolean_t flushed = ISC_FALSE;
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);
RUNTIME_CHECK(result == ISC_R_SUCCESS);
for (view = ISC_LIST_HEAD(server->viewlist);
view != NULL;
view = ISC_LIST_NEXT(view, link))
{
+ if (viewname != NULL && strcasecmp(viewname, view->name) != 0)
+ continue;
result = dns_view_flushcache(view);
if (result != ISC_R_SUCCESS)
goto out;
+ flushed = ISC_TRUE;
}
- result = ISC_R_SUCCESS;
+ if (flushed)
+ result = ISC_R_SUCCESS;
+ else
+ result = ISC_R_FAILURE;
out:
isc_task_endexclusive(server->task);
return (result);
* 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
trace Increment debugging level by one.\n\
trace level Change the debugging level.\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\
*restart Restart the server.\n\
\n\