fertling about.
authorChris Koeritz <fred@gruntose.com>
Sun, 7 Oct 2012 23:03:32 +0000 (19:03 -0400)
committerChris Koeritz <fred@gruntose.com>
Sun, 7 Oct 2012 23:03:32 +0000 (19:03 -0400)
nucleus/library/filesystem/directory_tree.cpp
octopi/library/octopus/entity_data_bin.cpp
octopi/library/octopus/tentacle.cpp
octopi/library/octopus/tentacle.h
octopi/library/tentacles/file_transfer_tentacle.cpp
octopi/library/tentacles/recursive_file_copy.cpp
scripts/clam/cpp/rules.def

index 05228969bf27dcf0b14298f8014b4da619b851cc..621b73cd271369f9f3790c5d044ce8eb7049f1d6 100644 (file)
@@ -39,7 +39,6 @@ using namespace textual;
 
 #undef LOG
 #define LOG(to_print) CLASS_EMERGENCY_LOG(program_wide_logger::get(), to_print)
-//printf("%s::%s: %s\n", static_class_name(), func, astring(to_print).s())
 
 //////////////
 
@@ -234,7 +233,9 @@ bool directory_tree::reset(const astring &path, const char *pattern)
   *_pattern = pattern;
   _real_tree = new filename_tree;
 
-LOG(astring("dirtree::reset to path: ") + path);
+#ifdef DEBUG_DIRECTORY_TREE
+  LOG(astring("dirtree::reset to path: ") + path);
+#endif
 
   // check that the top-level is healthy.
   directory curr(path, "*");
@@ -445,7 +446,7 @@ filename_tree *directory_tree::seek(const astring &dir_name_in,
       filename current(check->_dirname);
       if (!current.is_normal()) {
 //#ifdef DEBUG_DIRECTORY_TREE
-        LOG(astring("seek: skipping abnormal dir: \"") + current + "\" with came from " + check->class_name());
+        LOG(astring("seek: skipping abnormal dir: \"") + current + "\"");
 //#endif
         continue;
       }
@@ -495,6 +496,9 @@ bool directory_tree::calculate(bool just_size)
 bool directory_tree::calculate(filename_tree *start, bool just_size)
 {
   FUNCDEF("calculate");
+//#ifdef DEBUG_DIRECTORY_TREE
+  LOG(astring("calculate: got tree to start with at ") + start->_dirname.raw());
+//#endif
   dir_tree_iterator *ted = start_at(start, directory_tree::postfix);
     // create our iterator to do a postfix traversal.  why postfix?  well,
     // prefix has been used elsewhere and since it doesn't really matter what
@@ -641,10 +645,10 @@ bool directory_tree::compare_trees(const directory_tree &source,
     if (!target_now) {
       // that entire sub-tree is missing.  add all of the files here into
       // the list.
-#ifdef DEBUG_DIRECTORY_TREE
+//#ifdef DEBUG_DIRECTORY_TREE
       LOG(astring("could not find dir in target for ") + curr.raw()
           + " which we computed corresp as " + corresponding_name.raw());
-#endif
+//#endif
     }
 
     // now scan across all the files that are in our source list.
index 427deb1658e0bc0440cbf8f13bb7ee280965826b..fd877d7bb67d64c7505bb08d0bd36f34d2adc92a 100644 (file)
@@ -241,6 +241,7 @@ bool entity_data_bin::add_item(infoton *to_add,
 
   if (current_size + to_add->packed_size() > _max_per_ent) {
     WHACK(holder);
+LOG(astring("size limit would be exceeded if we stored this product"));
     return false;
   }
   
index 7c618033de97b43d6e062c855a7255857634f144..cda8f3d2d90a03f15ff40813bce11436278638b3 100644 (file)
 
 #include <basis/astring.h>
 #include <basis/mutex.h>
+#include <loggers/program_wide_logger.h>
 #include <processes/ethread.h>
 #include <structures/amorph.h>
 
 using namespace basis;
+using namespace loggers;
 using namespace processes;
 using namespace structures;
 
@@ -99,6 +101,8 @@ const char *tentacle::outcome_name(const outcome &to_name)
 int tentacle::motivational_rate() const
 { if (_action) return _action->sleep_time(); else return 0; }
 
+entity_data_bin *tentacle::get_storage() { return _products; }
+
 void tentacle::attach_storage(entity_data_bin &storage)
 {
   _products = &storage;
@@ -114,13 +118,11 @@ void tentacle::detach_storage()
 bool tentacle::store_product(infoton *product,
     const octopus_request_id &original_id)
 {
-#ifdef DEBUG_TENTACLE
   FUNCDEF("store_product");
-#endif
   if (!_products) {
-#ifdef DEBUG_TENTACLE
+//#ifdef DEBUG_TENTACLE
     LOG("storage bunker has not been established!");
-#endif
+//#endif
     return false;
   }
   return _products->add_item(product, original_id);
@@ -167,9 +169,7 @@ infoton *tentacle::next_request(octopus_request_id &item_id)
 
 void tentacle::propel_arm()
 {
-#ifdef DEBUG_TENTACLE
   FUNCDEF("propel_arm");
-#endif
   infoton *next_item = NIL;
   do {
     octopus_request_id id;
index abbc759ad4900c6c87c4d4bd149bb87eb83d74fe..c4352d8501abfc1ff15af5add9eb051b99d47444 100644 (file)
@@ -164,6 +164,8 @@ public:
     when detach is called. */
   void detach_storage();
     //!< unhooks the storage bin from this tentacle.
+  entity_data_bin *get_storage();
+    //!< returns the current pointer, which might be nil.
 
   void propel_arm();
     //!< invoked by our thread to cause requests to be processed.
index 068e59fb31493a2fd780307cda29cb0004f0f9f2..50cc5114b5ea97b1499d48e30d10417d868d6434 100644 (file)
@@ -21,6 +21,7 @@
 #include <filesystem/heavy_file_ops.h>
 #include <loggers/program_wide_logger.h>
 #include <octopus/entity_defs.h>
+#include <octopus/entity_data_bin.h>
 #include <octopus/unhandled_request.h>
 #include <processes/ethread.h>
 #include <textual/parser_bits.h>
@@ -558,9 +559,13 @@ outcome file_transfer_tentacle::handle_tree_compare_request
 //      before the client starts the transfer.
 
   reply->_request = false;  // it's a response now.
+LOG("storing product from transfer processing");
   store_product(reply, item_id);
     // send back the comparison list.
 
+LOG("now showing bin before return:");
+LOG(get_storage()->text_form());
+
   return OKAY;
 }
 
index baf40fe75afcd3731996a5d4d4421a839230d848..3272ad0f7f4647be0d497bbb4a340ec5e6850d24 100644 (file)
@@ -26,6 +26,7 @@
 #include <filesystem/huge_file.h>
 #include <loggers/program_wide_logger.h>
 #include <octopus/entity_defs.h>
+#include <octopus/entity_data_bin.h>
 #include <octopus/octopus.h>
 #include <structures/static_memory_gremlin.h>
 #include <textual/string_manipulation.h>
@@ -117,8 +118,11 @@ outcome recursive_file_copy::copy_hierarchy(int transfer_mode,
 
   file_transfer_infoton *reply_from_init
       = (file_transfer_infoton *)ring_leader.acquire_specific_result(req_id);
-  if (!reply_from_init)
+  if (!reply_from_init) {
+LOG("spewing list of what IS there...");
+LOG(ring_leader.responses().text_form());
     RETURN_ERROR_RFC("no response to tree compare start", NONE_READY);
+  }
 
   filename_list diffs;
   byte_array pack_copy = reply_from_init->_packed_data;
index 4bef18a37ed963c7c7a5bfb6ace3e2d448629600..6e4338cb3ebd210c8f57571571f1ce72233c97c1 100644 (file)
@@ -21,7 +21,7 @@ ifneq "$(findstring test, $(TYPE))" ""
   # and run them again.
 #hmmm: this is a kludge to make sure we always run the tests.  there has got
 #      to be a better way.
-  LAST_TARGETS += clean
+#  LAST_TARGETS += clean
 endif
 
 # see if they have got the clean flag set.  if so, we will not build anything.