#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())
//////////////
*_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, "*");
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;
}
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
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.
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;
}
#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;
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;
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);
void tentacle::propel_arm()
{
-#ifdef DEBUG_TENTACLE
FUNCDEF("propel_arm");
-#endif
infoton *next_item = NIL;
do {
octopus_request_id id;
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.
#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>
// 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;
}
#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>
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;
# 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.