From: Chris Koeritz Date: Sun, 7 Oct 2012 23:03:32 +0000 (-0400) Subject: fertling about. X-Git-Tag: 2.140.90~1197 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=fc8ec007bcbe990fc374f1a3019547e13554c496;p=feisty_meow.git fertling about. --- diff --git a/nucleus/library/filesystem/directory_tree.cpp b/nucleus/library/filesystem/directory_tree.cpp index 05228969..621b73cd 100644 --- a/nucleus/library/filesystem/directory_tree.cpp +++ b/nucleus/library/filesystem/directory_tree.cpp @@ -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. diff --git a/octopi/library/octopus/entity_data_bin.cpp b/octopi/library/octopus/entity_data_bin.cpp index 427deb16..fd877d7b 100644 --- a/octopi/library/octopus/entity_data_bin.cpp +++ b/octopi/library/octopus/entity_data_bin.cpp @@ -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; } diff --git a/octopi/library/octopus/tentacle.cpp b/octopi/library/octopus/tentacle.cpp index 7c618033..cda8f3d2 100644 --- a/octopi/library/octopus/tentacle.cpp +++ b/octopi/library/octopus/tentacle.cpp @@ -19,10 +19,12 @@ #include #include +#include #include #include 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; diff --git a/octopi/library/octopus/tentacle.h b/octopi/library/octopus/tentacle.h index abbc759a..c4352d85 100644 --- a/octopi/library/octopus/tentacle.h +++ b/octopi/library/octopus/tentacle.h @@ -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. diff --git a/octopi/library/tentacles/file_transfer_tentacle.cpp b/octopi/library/tentacles/file_transfer_tentacle.cpp index 068e59fb..50cc5114 100644 --- a/octopi/library/tentacles/file_transfer_tentacle.cpp +++ b/octopi/library/tentacles/file_transfer_tentacle.cpp @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -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; } diff --git a/octopi/library/tentacles/recursive_file_copy.cpp b/octopi/library/tentacles/recursive_file_copy.cpp index baf40fe7..3272ad0f 100644 --- a/octopi/library/tentacles/recursive_file_copy.cpp +++ b/octopi/library/tentacles/recursive_file_copy.cpp @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -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; diff --git a/scripts/clam/cpp/rules.def b/scripts/clam/cpp/rules.def index 4bef18a3..6e4338cb 100644 --- a/scripts/clam/cpp/rules.def +++ b/scripts/clam/cpp/rules.def @@ -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.