[Reconnoiter-devel] [reconnoiter commit] Reconnoiter branch, master, updated. c4fc37fcf1cb3f31782b792228a0b35e4cdf2acf

git at labs.omniti.com git at labs.omniti.com
Thu Feb 9 11:18:00 EST 2012


Pushed by: jesus
The branch, master has been updated
       via  c4fc37fcf1cb3f31782b792228a0b35e4cdf2acf (commit)
      from  84946f61e6afce7b0233ffa59881e9aac9dced36 (commit)

Summary of changes:
 src/noit_check_rest.c   |    9 +++++++--
 src/noit_filters_rest.c |    4 +++-
 2 files changed, 10 insertions(+), 3 deletions(-)

Log:
commit c4fc37fcf1cb3f31782b792228a0b35e4cdf2acf
Author: Theo Schlossnagle <jesus at omniti.com>
Date:   Thu Feb 9 11:17:56 2012 -0500

    make the rest calls dirty the right bits for shatter output

diff --git a/src/noit_check_rest.c b/src/noit_check_rest.c
index e6ed4dd..9e81a2f 100644
--- a/src/noit_check_rest.c
+++ b/src/noit_check_rest.c
@@ -211,6 +211,7 @@ rest_show_check(noit_http_rest_closure_t *restc,
     NODE_CONTENT(config, k, data);
   noit_hash_destroy(configh, free, free);
   free(configh);
+
   mod_cnt = noit_check_registered_module_cnt();
   for(mod=0; mod<mod_cnt; mod++) {
     xmlNsPtr ns;
@@ -419,6 +420,7 @@ configure_xml_check(xmlNodePtr check, xmlNodePtr a, xmlNodePtr c) {
     xmlFreeNode(oldconfig);
   }
   else xmlAddChild(check, config);
+  CONF_DIRTY(config);
 }
 static xmlNodePtr
 make_conf_path(char *path) {
@@ -441,6 +443,7 @@ make_conf_path(char *path) {
     if(!tmp) {
       tmp = xmlNewNode(NULL, (xmlChar *)tok);
       xmlAddChild(start, tmp);
+      CONF_DIRTY(tmp);
     }
     start = tmp;
   }
@@ -490,9 +493,9 @@ rest_delete_check(noit_http_rest_closure_t *restc,
   CONF_REMOVE(node);
   xmlUnlinkNode(node);
   xmlFreeNode(node);
+  noit_conf_mark_changed();
   if(noit_conf_write_file(NULL) != 0)
     noitL(noit_error, "local config write failed\n");
-  noit_conf_mark_changed();
   noit_http_response_ok(ctx, "text/html");
   noit_http_response_end(ctx);
   goto cleanup;
@@ -576,6 +579,7 @@ rest_set_check(noit_http_rest_closure_t *restc,
       parent = make_conf_path(pats[0]);
       if(!parent) FAIL("invalid path");
       xmlAddChild(parent, newcheck);
+      CONF_DIRTY(newcheck);
     }
   }
   if(exists) {
@@ -612,11 +616,12 @@ rest_set_check(noit_http_rest_closure_t *restc,
     if(!parent) FAIL("invalid path");
     xmlUnlinkNode(node);
     xmlAddChild(parent, node);
+    CONF_DIRTY(node);
   }
 
+  noit_conf_mark_changed();
   if(noit_conf_write_file(NULL) != 0)
     noitL(noit_error, "local config write failed\n");
-  noit_conf_mark_changed();
   noit_poller_reload(xpath);
   if(restc->call_closure_free) restc->call_closure_free(restc->call_closure);
   restc->call_closure_free = NULL;
diff --git a/src/noit_filters_rest.c b/src/noit_filters_rest.c
index 469e06e..a91002f 100644
--- a/src/noit_filters_rest.c
+++ b/src/noit_filters_rest.c
@@ -107,6 +107,7 @@ make_conf_path(char *path) {
     if(!tmp) {
       tmp = xmlNewNode(NULL, (xmlChar *)tok);
       xmlAddChild(start, tmp);
+      CONF_DIRTY(tmp);
     }
     start = tmp;
   }
@@ -208,10 +209,11 @@ rest_set_filter(noit_http_rest_closure_t *restc,
   }
   xmlUnlinkNode(newfilter);
   xmlAddChild(parent, newfilter);
+  CONF_DIRTY(newfilter);
 
+  noit_conf_mark_changed();
   if(noit_conf_write_file(NULL) != 0)
     noitL(noit_error, "local config write failed\n");
-  noit_conf_mark_changed();
   noit_filter_compile_add(newfilter);
   if(restc->call_closure_free) restc->call_closure_free(restc->call_closure);
   restc->call_closure_free = NULL;




hooks/post-receive
-- 
Reconnoiter


More information about the Reconnoiter-devel mailing list