]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
842. [func] 'rndc flush' now takes an optional view.
authorBrian Wellington <source@isc.org>
Thu, 31 May 2001 01:21:12 +0000 (01:21 +0000)
committerBrian Wellington <source@isc.org>
Thu, 31 May 2001 01:21:12 +0000 (01:21 +0000)
CHANGES
bin/named/control.c
bin/named/include/named/server.h
bin/named/server.c
bin/rndc/rndc.c

diff --git a/CHANGES b/CHANGES
index f2133be92f37549d4c602a8de5062fa0deaa87d9..79ad672c0e87c9ae163b75df721ff73a70dba45c 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,5 @@
+ 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.
 
index 223b3fccc27d3cadbb7903b9764da3b39ffd17b8..6ab225153cc2e745af2fa6fca3ca6eb23698bc86 100644 (file)
@@ -15,7 +15,7 @@
  * 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>
 
@@ -107,7 +107,7 @@ ns_control_docommand(isccc_sexpr_t *message, isc_buffer_t *text) {
                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 {
index 9e30476fa1057c66c9c3810a4064525f0acafaa5..933815426d5cc8f37ec1fd411a1db4fd31cd7fca 100644 (file)
@@ -15,7 +15,7 @@
  * 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
@@ -160,7 +160,7 @@ ns_server_setdebuglevel(ns_server_t *server, char *args);
  * 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.
index 853de64cf16b0f0a855b0946969de8ba548d723f..480e485055cfb0f6d83acbf3eba250b56e066dee 100644 (file)
@@ -15,7 +15,7 @@
  * 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>
 
@@ -2758,21 +2758,37 @@ ns_server_setdebuglevel(ns_server_t *server, char *args) {
 }
 
 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);
index b47a3930f77d870328596ad880652f925fd67783..a55970584a226ea8484cf0cc2001f2e08387155d 100644 (file)
@@ -15,7 +15,7 @@
  * 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
@@ -112,7 +112,8 @@ command is one of the following:\n\
   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\