[Opendnssec-commits] [keihatsu.kirei.se/svn/dnssec] r4085 - trunk/OpenDNSSEC/signer/src/daemon

Matthijs Mekking matthijs at nlnetlabs.nl
Tue Oct 12 14:54:38 CEST 2010


Author: matthijs
Date: 2010-10-12 14:54:38 +0200 (Tue, 12 Oct 2010)
New Revision: 4085

Modified:
   trunk/OpenDNSSEC/signer/src/daemon/cmdhandler.c
   trunk/OpenDNSSEC/signer/src/daemon/engine.c
   trunk/OpenDNSSEC/signer/src/daemon/engine.h
Log:
better feedback message for update <zone> when zone not found



Modified: trunk/OpenDNSSEC/signer/src/daemon/cmdhandler.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/daemon/cmdhandler.c	2010-10-12 10:23:32 UTC (rev 4084)
+++ trunk/OpenDNSSEC/signer/src/daemon/cmdhandler.c	2010-10-12 12:54:38 UTC (rev 4085)
@@ -166,7 +166,7 @@
         tbd = NULL;
     }
     se_log_info("cmdhandler: updating signer configuration (%s)", tbd?tbd:"--all");
-    ret = engine_update_zones(cmdc->engine, tbd, buf);
+    ret = engine_update_zones(cmdc->engine, tbd, buf, 1);
     se_writen(sockfd, buf, strlen(buf));
 
     if (tbd && ret != 0) {
@@ -175,7 +175,7 @@
         se_writen(sockfd, buf, strlen(buf));
 
         /* try again */
-        ret = engine_update_zones(cmdc->engine, tbd, buf);
+        ret = engine_update_zones(cmdc->engine, tbd, buf, 0);
         se_writen(sockfd, buf, strlen(buf));
     }
 

Modified: trunk/OpenDNSSEC/signer/src/daemon/engine.c
===================================================================
--- trunk/OpenDNSSEC/signer/src/daemon/engine.c	2010-10-12 10:23:32 UTC (rev 4084)
+++ trunk/OpenDNSSEC/signer/src/daemon/engine.c	2010-10-12 12:54:38 UTC (rev 4085)
@@ -634,7 +634,8 @@
  *
  */
 int
-engine_update_zones(engine_type* engine, const char* zone_name, char* buf)
+engine_update_zones(engine_type* engine, const char* zone_name, char* buf,
+    int first_try)
 {
     ldns_rbnode_t* node = LDNS_RBTREE_NULL;
     zone_type* zone = NULL;
@@ -693,8 +694,8 @@
     if (zone_name) {
         se_log_debug("zone %s not found", zone_name);
         if (buf) {
-            (void)snprintf(buf, ODS_SE_MAXLINE, "Zone %s not found, "
-                "updating zone list.\n", zone_name);
+            (void)snprintf(buf, ODS_SE_MAXLINE, "Zone %s not found%s.\n",
+            zone_name, first_try?", updating zone list":"");
         }
         return 1;
     } else {
@@ -914,7 +915,7 @@
         }
 
         if (zl_changed) {
-            zl_changed = engine_update_zones(engine, NULL, NULL);
+            zl_changed = engine_update_zones(engine, NULL, NULL, 0);
             zl_changed = 0;
         }
 

Modified: trunk/OpenDNSSEC/signer/src/daemon/engine.h
===================================================================
--- trunk/OpenDNSSEC/signer/src/daemon/engine.h	2010-10-12 10:23:32 UTC (rev 4084)
+++ trunk/OpenDNSSEC/signer/src/daemon/engine.h	2010-10-12 12:54:38 UTC (rev 4085)
@@ -109,10 +109,12 @@
  * \param[in] the signer engine
  * \paran[in] zone_name update only this zone
  * \param[in] buf response message
+ * \param[in] first_try if true, update zone list if zone not found
  * \return int 1 if zone was not found (zone_name != NULL)
  *
  */
-int engine_update_zones(engine_type* engine, const char* zone_name, char* buf);
+int engine_update_zones(engine_type* engine, const char* zone_name, char* buf,
+    int first_try);
 
 
 /**




More information about the Opendnssec-commits mailing list