mode complained about the unused ones, but that was aggravating; we want the FUNCDEF to
be available anywhere, regardless of whether debugging is using it or not.
bool bookmark_tree::magic_category_comparison(const astring &a, const astring &b)
{
-// FUNCDEF("magic_category_comparison");
+ FUNCDEF("magic_category_comparison");
//LOG(astring("compare: a=") + a + " b=" + b);
if (a.iequals(b)) return true;
astring a_name, a_nick;
void bookmark_tree::process_comment(const astring ¤t_line_in)
{
-/// FUNCDEF("process_comment");
+ FUNCDEF("process_comment");
astring current_line = current_line_in;
// output the comment as simple text.
void marks_maker_javascript::write_category(inner_mark_tree *node, astring &output)
{
-// FUNCDEF("write_category");
+ FUNCDEF("write_category");
// output a javascript line for the category.
int node_num = node->_uid;
void marks_maker_javascript::write_link(inner_mark_tree *node, const link_record &linko,
astring &output)
{
-// FUNCDEF("write_link");
+ FUNCDEF("write_link");
// write a javascript link definition.
int parent_node = node->_uid;
astring chewed_name = linko._description;
int marks_maker_javascript::execute()
{
-// FUNCDEF("execute");
+ FUNCDEF("execute");
SETUP_COMBO_LOGGER;
command_line cmds(_global_argc, _global_argv); // process the command line parameters.
int bundle_creator::recurse_into_dir(const astring &source,
const astring &target, int manifest_index)
{
-// FUNCDEF("recurse_into_dir");
+ FUNCDEF("recurse_into_dir");
//LOG(astring("src=") + source + " dest=" + target);
// we won't include the subversion folder.
int bundle_creator::patch_recursive_target(const astring &source,
const astring &target, int manifest_index)
{
-// FUNCDEF("patch_recursive_target");
+ FUNCDEF("patch_recursive_target");
//LOG(astring("patch recurs src=") + source + " targ=" + target);
return recurse_into_dir(source, target, manifest_index);
}
int bundle_creator::patch_wildcard_target(const astring &source,
const astring &target, int manifest_index)
{
-// FUNCDEF("patch_wildcard_target");
+ FUNCDEF("patch_wildcard_target");
// find the last slash. the rest is our wildcard component.
int src_end = source.end();
int slash_indy = source.find('/', src_end, true);
int bundle_creator::write_offset()
{
-// FUNCDEF("write_offset");
+ FUNCDEF("write_offset");
byte_filer bun(_output_file, "r+b"); // open the file for updating.
astring magic_string("muftiloc"); // our sentinel string.
bool manifest_chunk::read_an_int(byte_filer &bundle, un_int &found)
{
-// FUNCDEF("read_an_int");
+ FUNCDEF("read_an_int");
byte_array temp;
if (bundle.read(temp, sizeof(int)) != sizeof(int)) return false;
if (!structures::detach(temp, found)) return false;
bool manifest_chunk::read_an_obscured_int(byte_filer &bundle, un_int &found)
{
-// FUNCDEF("read_an_obscured_int");
+ FUNCDEF("read_an_obscured_int");
byte_array temp;
if (bundle.read(temp, 2 * sizeof(int)) != 2 * sizeof(int)) return false;
if (!structures::obscure_detach(temp, found)) return false;
bool manifest_chunk::read_a_filetime(byte_filer &bundle, byte_array &found)
{
-// FUNCDEF("read_a_filetime");
+ FUNCDEF("read_a_filetime");
byte_array temp;
// the trick below only works because we know we have a constant sized packed version
// for the file time.
astring manifest_chunk::read_a_string(byte_filer &bundle)
{
-// FUNCDEF("read_a_string");
+ FUNCDEF("read_a_string");
astring found;
byte_array temp;
// read in the zero-terminated character string.
string_array command_line::get_command_line()
{
-// FUNCDEF("get_command_line");
+ FUNCDEF("get_command_line");
string_array listo_cmds;
// the temporary string below can be given a flat formatting of the commands
// and it will be popped out into a list of arguments.
_gag_exclusions(new string_set),
_tracking_exclusions(new string_set)
{
-// FUNCDEF("constructor");
+ FUNCDEF("constructor");
// start the application checking thread.
_checker->start(NIL);
bool launch_manager::find_process(const astring &app_name_in, int_set &pids)
{
-// FUNCDEF("find_process");
+ FUNCDEF("find_process");
pids.clear();
process_entry_array processes;
if (!get_processes(processes)) return false;
outcome stdio_redirecter::launch_program(int &new_process_id)
{
-// FUNCDEF("launch_program");
+ FUNCDEF("launch_program");
new_process_id = 0;
#ifdef __UNIX__
int fork_ret = fork();
outcome stdio_redirecter::write(const byte_array &to_write, int &written)
{
-// FUNCDEF("write");
+ FUNCDEF("write");
written = 0;
if (_persistent_result != OKAY) return _persistent_result;
#ifdef __UNIX__
void stdio_redirecter::std_thread_action(bool is_stdout)
{
-// FUNCDEF("std_thread_action");
+ FUNCDEF("std_thread_action");
byte_array buff(BUFFER_SIZE + 1);
#ifdef __UNIX__
bool ret = false;
_identity(new astring(identity)),
_size(size)
{
-// FUNCDEF("constructor");
+ FUNCDEF("constructor");
bool first_use = false; // assume already existing until told otherwise.
_locking->lock(); // force all others to wait on our finishing creation.
#ifdef __UNIX__
// deprecated; better to use the /proc/pid/cmdline file.
astring application_configuration::query_for_process_info()
{
-// FUNCDEF("query_for_process_info");
+ FUNCDEF("query_for_process_info");
astring to_return = "unknown";
// we ask the operating system about our process identifier and store
// the results in a temporary file.
astring application_configuration::application_name()
{
-// FUNCDEF("application_name");
+ FUNCDEF("application_name");
astring to_return;
#ifdef __APPLE__
char buffer[MAX_ABS_PATH] = { '\0' };
bool ini_configurator::put(const astring §ion, const astring &entry,
const astring &to_store)
{
-/// FUNCDEF("put");
+ FUNCDEF("put");
if (!to_store.length()) return delete_entry(section, entry);
else if (!entry.length()) return delete_section(section);
else if (!section.length()) return false;
bool ini_configurator::get_section(const astring §ion, string_table &info)
{
-/// FUNCDEF("get_section");
+ FUNCDEF("get_section");
#ifndef __WIN32__
return _parser->get_section(section, info);
#else
_list(new system_values_lookup_list),
_file(new astring(DEFAULT_MANIFEST))
{
-// FUNCDEF("constructor");
+ FUNCDEF("constructor");
open_values();
}
bool system_values::open_values()
{
-// FUNCDEF("open_values");
+ FUNCDEF("open_values");
ini_configurator ini(*_file, ini_configurator::RETURN_ONLY,
ini_configurator::APPLICATION_DIRECTORY);
bool table_configurator::get_section(const astring §ion,
string_table &info)
{
-/// FUNCDEF("get_section");
+ FUNCDEF("get_section");
info.reset();
string_table *sect = _real_table->find(section);
if (!sect) return false;
bool table_configurator::put_section(const astring §ion,
const string_table &info)
{
-/// FUNCDEF("put_section");
+ FUNCDEF("put_section");
string_table *sect = _real_table->find(section);
if (!sect) {
// none exists yet, so add one.
using namespace structures;
using namespace textual;
-//#define DEBUG_DIRECTORY_TREE
+#define DEBUG_DIRECTORY_TREE
// uncomment for noisier version.
#undef LOG
bool directory_tree::reset(const astring &path, const char *pattern)
{
+ FUNCDEF("reset");
_scanned_okay = false;
WHACK(_real_tree);
+// filename temp_path(path);
+// temp_path.canonicalize();
*_path = path;
+//temp_path.raw();
*_pattern = pattern;
_real_tree = new filename_tree;
+LOG(astring("dirtree::reset to path: ") + path);
+
// check that the top-level is healthy.
directory curr(path, "*");
if (!curr.good()) return false;
if (target_start.raw().t()) {
corresponding_name = filename(target_start.raw()
+ filename::default_separator() + corresponding_name.raw());
+/*doesn't help, not right yet. } else {
+ // if they didn't give us a place to start, we start at the top.
+ corresponding_name = filename(target.path()
+ + filename::default_separator() + corresponding_name.raw());
+*/
}
#ifdef DEBUG_DIRECTORY_TREE
LOG(astring("target with start is: ") + corresponding_name);
if (separator(raw_form[i])) {
// this is a separator character, so eat it and add the accumulated
// string to the list.
- if (!i || accumulator.length()) pieces += accumulator;
+ if (i && accumulator.length()) pieces += accumulator;
// now reset our accumulated text.
accumulator = astring::empty_string();
} else {
character that is substituted instead of illegal characters. */
void separate(structures::string_array &pieces) const;
- //!< breaks the filename into its component directories.
+ //!< breaks the filename into its component parts.
/*!< this returns an array containing the component names. the last
component, unless the filename held is actually a directory, should be the
- name of the file. if the first character is a directory, then the first
+ name of the file.
+//hmmm: what does this mean, below?
+ if the first character is a directory, then the first
component will be empty. */
void join(const structures::string_array &pieces);
//////////////
+// the smallest we let the packing area's available space get before we stop filling it.
+const int MINIMUM_ARRAY_SIZE = 1024;
+
+//////////////
+
file_transfer_header::file_transfer_header(const file_time &time_stamp)
: _filename(),
_byte_start(0),
double byte_start, const byte_array &chunk, bool truncate,
int copy_chunk_factor)
{
-#ifdef DEBUG_HEAVY_FILE_OPS
-// FUNCDEF("write_file_chunk");
-#endif
+ FUNCDEF("write_file_chunk");
if (byte_start < 0) return BAD_INPUT;
filename targ_name(target);
while (storage.length() < maximum_bytes) {
double remaining_in_array = maximum_bytes - storage.length()
- last_action.packed_size();
- if (remaining_in_array < 128) {
+ if (remaining_in_array < MINIMUM_ARRAY_SIZE) {
// ensure that we at least have a reasonable amount of space left
// for storing into the array.
break;
huge_file current(full_file, "rb");
if (!current.good()) {
// we need to skip this file.
-LOG(astring("skipping bad file: ") + full_file);
+ LOG(astring("skipping bad file: ") + full_file);
to_return = advance(to_transfer, last_action);
if (to_return != OKAY) break;
continue;
}
if (last_action._byte_start + last_action._length >= current.length()) {
-LOG(astring("finished stuffing file: ") + full_file);
// this file is done now. go to the next one.
+ LOG(astring("finished stuffing file: ") + full_file);
to_return = advance(to_transfer, last_action);
if (to_return != OKAY) break;
continue;
{
public:
basis::astring _filename; //!< the name of the file being transferred.
+//hmmm: consider adding full length here so we know it.
double _byte_start; //!< the starting location in the file being sent.
int _length; //!< the length of the transferred piece.
file_time _time; //!< the timestamp on the file.
outcome huge_file::read(byte_array &to_fill, int desired_size, int &size_read)
{
-// FUNCDEF("read");
+ FUNCDEF("read");
size_read = 0;
int ret = _real_file->read(to_fill, desired_size);
if (ret < 0)
outcome huge_file::write(const byte_array &to_write, int &size_written)
{
-// FUNCDEF("write");
+ FUNCDEF("write");
size_written = 0;
int ret = _real_file->write(to_write);
if (ret < 0)
using namespace basis;
using namespace structures;
-//#define DEBUG_PACKABLE_TREE
+#define DEBUG_PACKABLE_TREE
// uncomment for noisy debugging.
#undef LOG
void packable_tree::packit(byte_array &packed_form, const packable_tree *current_node)
{
-LOG(a_sprintf("packing node %x", current_node));
-LOG(a_sprintf("size A %d", packed_form.length()));
+//LOG(a_sprintf("packing node %x", current_node));
+//LOG(a_sprintf("size A %d", packed_form.length()));
FUNCDEF("packit");
if (!current_node) throw_error(static_class_name(), func, "current node is nil");
}
// stuff the command unit.
command.pack(packed_form);
-LOG(a_sprintf("size B %d", packed_form.length()));
+//LOG(a_sprintf("size B %d", packed_form.length()));
packed_form += temp_store; // main chunk is not packed, just added.
-LOG(a_sprintf("size C %d", packed_form.length()));
+//LOG(a_sprintf("size C %d", packed_form.length()));
}
int packable_tree::recursive_packed_size() const
_sector(new section_manager(*_config, astring(basename) + "_TOC",
astring(PRODUCT_HEADING()) + "_"))
{
-// FUNCDEF("constructor");
+ FUNCDEF("constructor");
string_table startup_info;
if (!find_section(STARTUP_SECTION(), startup_info)) {
// if there's no startup section, we do nothing right now.
bool configured_applications::remove_program(const astring &product,
const astring &app_name)
{
-// FUNCDEF("remove_program");
+ FUNCDEF("remove_program");
auto_synchronizer l(*_lock);
// if the section's missing, there's nothing to remove...
string_table info_table;
bool configured_applications::find_section(const astring §ion_name,
string_table &info_found)
{
-// FUNCDEF("find_section");
+ FUNCDEF("find_section");
info_found.reset();
auto_synchronizer l(*_lock);
if (!_sector->find_section(section_name, info_found)) {
bool configured_applications::parse_startup_entry(const astring &info,
astring &product, astring &parms, bool &one_shot)
{
-// FUNCDEF("parse_startup_section");
+ FUNCDEF("parse_startup_section");
// parse the items that are in the entry for this program.
variable_tokenizer entry_parser(SEPARATOR_TOKEN(), ASSIGN_TOKEN());
entry_parser.parse(info);
bool configured_applications::add_startup_entry(const astring &product,
const astring &app_name, const astring ¶meters, int one_shot)
{
-// FUNCDEF("add_startup_entry");
+ FUNCDEF("add_startup_entry");
auto_synchronizer l(*_lock);
LOG(astring("product \"") + product + "\", application \"" + app_name
bool configured_applications::remove_startup_entry(const astring &product,
const astring &app_name)
{
-// FUNCDEF("remove_startup_entry");
+ FUNCDEF("remove_startup_entry");
auto_synchronizer l(*_lock);
LOG(astring("product \"") + product + "\", application \"" + app_name + "\"");
_next_activation(new time_stamp),
_how(TIGHT_INTERVAL) // unused.
{
-// FUNCDEF("constructor [one-shot]");
+ FUNCDEF("constructor [one-shot]");
}
ethread::ethread(int sleep_timer, timed_thread_types how)
_next_activation(new time_stamp),
_how(how)
{
-// FUNCDEF("constructor [periodic]");
+ FUNCDEF("constructor [periodic]");
if (sleep_timer < MINIMUM_SLEEP_PERIOD) {
_sleep_time = MINIMUM_SLEEP_PERIOD;
}
#error unknown thread signature.
#endif
{
-// FUNCDEF("one_shot_thread_driver");
+ FUNCDEF("one_shot_thread_driver");
ethread *manager = (ethread *)hidden_pointer;
#ifdef __UNIX__
if (!manager) return NIL;
#error unknown thread signature.
#endif
{
-// FUNCDEF("periodic_thread_driver");
+ FUNCDEF("periodic_thread_driver");
ethread *manager = (ethread *)hidden_pointer;
#ifdef __UNIX__
if (!manager) return NIL;
process_entry process_control::query_process(basis::un_int to_query)
{
-// FUNCDEF("query_process");
+ FUNCDEF("query_process");
process_entry to_return;
process_entry_array to_fill;
bool memory_limiter::okay_allocation(int individual, int memory_desired)
{
-// FUNCDEF("okay_allocation");
+ FUNCDEF("okay_allocation");
// check the overall allocation limits first.
if (_overall_limit
&& (_overall_size + memory_desired > _overall_limit) ) return false;
void test_string::run_test_13()
{
-// FUNCDEF("run_test_13");
+ FUNCDEF("run_test_13");
// check for possible memory leaks in these combined ops.... 13th.
const astring churg("borjh sjh oiweoklj");
astring pud = churg;
void test_string::run_test_17()
{
-// FUNCDEF("run_test_17");
+ FUNCDEF("run_test_17");
// 17th test checks construction of temporaries.
/* this test set causes the obnoxious 16 bit codeguard error from hell, as
does use of temporary objects in ostream << operators. argh! */
void test_string::run_test_26()
{
-// FUNCDEF("run_test_26");
+ FUNCDEF("run_test_26");
// 26th test group does simple time_stamp::notarize operations. these are more for
// ensuring boundschecker gets to see some of this.
astring t2 = time_stamp::notarize(false);
void test_string::run_test_27()
{
-// FUNCDEF("run_test_27");
+ FUNCDEF("run_test_27");
// 27th test group plays around with idate in an attempt to get
// boundschecker to complain.
timely::day_in_year d1 = date_now();
void standard_sprintf_test(const char *parm_string)
{
-// FUNCDEF("standard_sprintf_test");
+ FUNCDEF("standard_sprintf_test");
astring print_into(' ', 20000);
print_into[0] = '\0';
//check these!!!:
void test_string::run_test_34()
{
-// FUNCDEF("run_test_34");
+ FUNCDEF("run_test_34");
//not in use right now.
void test_string::run_test_38()
{
-// FUNCDEF("run_test_38");
+ FUNCDEF("run_test_38");
double to_print = 2.345;
a_sprintf non_deadly("%.1f", to_print);
/// LOG(astring("printed: ") + non_deadly);
int test_byte_filer::execute()
{
-// FUNCDEF("execute");
+ FUNCDEF("execute");
int ret = run_simple_test();
if (ret) return ret; // failed.
ret = run_file_scan();
directory_tree dir2(path, pattern.s());
ASSERT_TRUE(dir2.good(), "the directory should read the second time fine too");
-// LOG("comparing the two trees.");
+ LOG("comparing the two trees.");
filename_list diffs;
directory_tree::compare_trees(dir, dir2, diffs, file_info::EQUAL_CHECKSUM_TIMESTAMP_FILESIZE);
-//LOG(diffs.text_form());
+LOG(diffs.text_form());
ASSERT_FALSE(diffs.elements(), "there should be no differences comparing identical dirs");
}
filename turkey("/omega/ralph/turkey/buzzard.txt");
string_array pieces;
turkey.separate(pieces);
- ASSERT_TRUE(pieces[1].equal_to("omega"), GROUP + "the first piece didn't match.");
- ASSERT_TRUE(pieces[2].equal_to("ralph"), GROUP + "the second piece didn't match.");
- ASSERT_TRUE(pieces[3].equal_to("turkey"), GROUP + "the third piece didn't match.");
- ASSERT_TRUE(pieces[4].equal_to("buzzard.txt"), GROUP + "the fourth piece didn't match.");
- ASSERT_EQUAL(pieces.length(), 5, GROUP + "the list was the wrong length");
+ ASSERT_TRUE(pieces[0].equal_to("omega"), GROUP + "the first piece didn't match.");
+ ASSERT_TRUE(pieces[1].equal_to("ralph"), GROUP + "the second piece didn't match.");
+ ASSERT_TRUE(pieces[2].equal_to("turkey"), GROUP + "the third piece didn't match.");
+ ASSERT_TRUE(pieces[3].equal_to("buzzard.txt"), GROUP + "the fourth piece didn't match.");
+ ASSERT_EQUAL(pieces.length(), 4, GROUP + "the list was the wrong length");
}
{
version_record version_ini::get_record()
{
-// FUNCDEF("get_record");
+ FUNCDEF("get_record");
if (_loaded) return *_held_record;
version_record to_return;
to_return.description = _ini->load(VERSION_SECTION, DESCRIPTION, "");
bool version_ini::write_assembly(const version_record &to_write,
bool do_logging)
{
-// FUNCDEF("write_assembly");
+ FUNCDEF("write_assembly");
filename just_dir = _path_name->dirname();
//LOG(astring("dir is set to: ") + just_dir);
directory dir(just_dir);
int version_stamper::execute()
{
-/// FUNCDEF("execute");
+ FUNCDEF("execute");
SETUP_CONSOLE_LOGGER; // override the file_logger from app_shell.
if (application::_global_argc < 2) {
log(astring("The directory where the 'version.ini' file is located\n"
bool vsts_version_fixer::spider_directory(directory start,
spider_method to_invoke)
{
-// FUNCDEF("spider_directory");
+ FUNCDEF("spider_directory");
using namespace basis;
bool whacking_spider(const directory ¤t)
{
-// FUNCDEF("whacking_spider");
+ FUNCDEF("whacking_spider");
using namespace basis;
//LOG(astring("whacking_spider: ") + current.path());
// iterate across the files in the directory and check for evil ones.
bool stamping_spider(const directory ¤t)
{
-// FUNCDEF("stamping_spider");
+ FUNCDEF("stamping_spider");
using namespace basis;
//LOG(astring("stamping_spider: ") + current.path());
bool vsts_version_fixer::perform_version_stamping(const filename &start_name)
{
-// FUNCDEF("perform_version_stamping");
+ FUNCDEF("perform_version_stamping");
directory start(start_name);
return spider_directory(start, stamping_spider);
}
outcome write_build_config::output_definition_macro
(const astring &embedded_value, astring &accumulator)
{
-// FUNCDEF("output_definition_macro");
+ FUNCDEF("output_definition_macro");
//LOG(astring("into output def with: ") + embedded_value);
variable_tokenizer t;
t.parse(embedded_value);
int create_guid::execute()
{
-// FUNCDEF("execute");
+ FUNCDEF("execute");
SETUP_CONSOLE_LOGGER;
#ifdef __UNIX__
int synch_files_tentacle::execute()
{
-// FUNCDEF("execute");
+ FUNCDEF("execute");
if (_global_argc < 3) {
log(astring("\
cromp_client::~cromp_client()
{
-// FUNCDEF("destructor");
+ FUNCDEF("destructor");
disconnect();
close_common();
_identified = false;
void cromp_client::enable_encryption()
{
-// FUNCDEF("enable_encryption");
+ FUNCDEF("enable_encryption");
AUTO_LOCK;
#ifdef DEBUG_CROMP_CLIENT
outcome cromp_client::connect(const byte_array &verification)
{
-// FUNCDEF("connect");
+ FUNCDEF("connect");
stop_asynch_thread();
AUTO_LOCK; // protect from multiple connect attempts.
*c_verification = verification;
_still_flat(new byte_array(CROMP_BUFFER_CHUNK_SIZE, NIL)),
_last_cleanup(new time_stamp)
{
-// FUNCDEF("constructor [host/max_per_ent]");
+ FUNCDEF("constructor [host/max_per_ent]");
// clear pre-existing space.
_accumulator->reset();
_sendings->reset();
cromp_common::~cromp_common()
{
-// FUNCDEF("destructor");
+ FUNCDEF("destructor");
close_common(); // shuts down our socket and other stuff.
if (_singleton) {
_singleton = NIL; // reset the pointer we had.
void cromp_common::conditional_cleaning()
{
-// FUNCDEF("conditional_cleaning");
+ FUNCDEF("conditional_cleaning");
if (time_stamp(-CLEANUP_INTERVAL) > *_last_cleanup) {
_requests->clean_out_deadwood();
// flush any items that are too old.
outcome cromp_common::retrieve_and_restore_root(bool get_anything,
infoton * &item, octopus_request_id &req_id, int timeout)
{
-// FUNCDEF("retrieve_and_restore_root");
+ FUNCDEF("retrieve_and_restore_root");
item = NIL;
if (!_commlink) return BAD_INPUT; // they haven't opened this yet.
octopus_request_id tmp_id;
// stops the background activity of this object and drops the connection
// to the client.
void croak() {
-// FUNCDEF("croak");
+ FUNCDEF("croak");
_grabber.stop();
int actions = 0;
while (get_incoming_data(actions)) {
_parent(parent) {}
void perform_activity(void *formal(ptr)) {
-// FUNCDEF("perform_activity");
+ FUNCDEF("perform_activity");
_parent.drop_dead_clients();
}
_parent(parent) {}
void perform_activity(void *formal(ptr)) {
-// FUNCDEF("perform_activity");
+ FUNCDEF("perform_activity");
_parent.look_for_clients(*this);
}
_default_security(new cromp_security),
_security_arm(NIL)
{
-// FUNCDEF("constructor");
+ FUNCDEF("constructor");
}
cromp_server::~cromp_server()
void cromp_server::disable_servers()
{
-// FUNCDEF("disable_servers");
+ FUNCDEF("disable_servers");
if (!_enabled) return;
_dropper->stop(); // signal the thread to leave when it can.
_accepters->stop_all(); // signal the accepting threads to exit.
bool cromp_server::disconnect_entity(const octopus_entity &id)
{
-// FUNCDEF("disconnect_entity");
+ FUNCDEF("disconnect_entity");
if (!_enabled) return false;
LOCK_LISTS;
int indy = _clients->find(id);
bool cromp_server::find_entity(const octopus_entity &id,
internet_address &found)
{
-// FUNCDEF("find_entity");
+ FUNCDEF("find_entity");
if (!_enabled) return false;
found = internet_address();
LOCK_LISTS;
outcome cromp_server::get_from_client(const octopus_request_id &id,
infoton * &data, int timeout)
{
-// FUNCDEF("get_from_client");
+ FUNCDEF("get_from_client");
if (!_enabled) return common::INCOMPLETE;
//hmmm: this implementation locks the lists; can't we get the client to do
// most of the work for this?
{
#undef static_class_name
#define static_class_name() "entity_data_bin"
-// FUNCDEF("scramble_applier");
+ FUNCDEF("scramble_applier");
int *county = (int *)data_link;
*county += bask.elements();
return true;
bool entity_data_bin::add_item(infoton *to_add,
const octopus_request_id &orig_id)
{
-// FUNCDEF("add_item");
+ FUNCDEF("add_item");
GRAB_LOCK;
// create a record to add to the appropriate bin.
infoton_holder *holder = new infoton_holder(orig_id, to_add);
bool any_item_applier(const octopus_entity &formal(key), entity_basket &bask,
void *data_link)
{
-//#ifdef DEBUG_ENTITY_DATA_BIN
-// #define static_class_name() "entity_data_bin"
-// FUNCDEF("any_item_applier");
-//#endif
+ #define static_class_name() "entity_data_bin"
+ FUNCDEF("any_item_applier");
apply_struct *apple = (apply_struct *)data_link;
// check the basket to see if it has any items.
if (!bask.elements()) {
int entity_data_bin::acquire_for_entity(const octopus_entity &requester,
infoton_list &items, int maximum_size)
{
-// FUNCDEF("acquire_for_entity [multiple]");
+ FUNCDEF("acquire_for_entity [multiple]");
// this method does not grab the lock because it simply composes other
// class methods without interacting with class data members.
items.reset();
bool entity_data_bin::get_sizes(const octopus_entity &id, int &items,
int &bytes)
{
-// FUNCDEF("get_sizes");
+ FUNCDEF("get_sizes");
items = 0;
bytes = 0;
GRAB_LOCK;
infoton::infoton(const string_array &classifier)
: _classifier(new string_array(classifier))
{
-// FUNCDEF("constructor [string_array]");
+ FUNCDEF("constructor [string_array]");
}
infoton::infoton(const astring &class_1)
: _classifier(new string_array)
{
-// FUNCDEF("constructor [one string]");
+ FUNCDEF("constructor [one string]");
*_classifier += class_1;
}
infoton::infoton(const astring &class_1, const astring &class_2)
: _classifier(new string_array)
{
-// FUNCDEF("constructor [two strings]");
+ FUNCDEF("constructor [two strings]");
*_classifier += class_1;
*_classifier += class_2;
}
const astring &class_3)
: _classifier(new string_array)
{
-// FUNCDEF("constructor [three strings]");
+ FUNCDEF("constructor [three strings]");
*_classifier += class_1;
*_classifier += class_2;
*_classifier += class_3;
void infoton::fast_pack(byte_array &packed_form, const infoton &to_pack)
{
-// FUNCDEF("fast_pack");
+ FUNCDEF("fast_pack");
structures::attach(packed_form, FAST_PACK_VERSION);
// add the tasty version byte as the very first item.
structures::pack_array(packed_form, to_pack.classifier());
bool infoton::test_fast_unpack(const byte_array &packed_form,
int &packed_length)
{
-// FUNCDEF("test_fast_unpack");
+ FUNCDEF("test_fast_unpack");
packed_length = 0;
if (!packed_form.length()) return false;
octopus::~octopus()
{
-// FUNCDEF("destructor");
+ FUNCDEF("destructor");
WHACK(_filters);
WHACK(_tentacles);
WHACK(_responses);
void octopus::periodic_cleaning()
{
-// FUNCDEF("periodic_cleaning");
+ FUNCDEF("periodic_cleaning");
time_stamp next_time;
{
auto_synchronizer l(*_clean_lock);
bool internet_address::ip_appropriate_number(const astring &to_check, int indy,
astring &accum)
{
-// FUNCDEF("ip_appropriate_number");
+ FUNCDEF("ip_appropriate_number");
accum.reset();
for (int i = indy; (i < indy + 3) && (i < to_check.length()); i++) {
// make sure it looks like a good number.
bool internet_address::has_ip_address(const astring &to_check,
astring &ip_found)
{
-// FUNCDEF("has_ip_address");
+ FUNCDEF("has_ip_address");
int nums_seen = 0;
ip_found.reset();
for (int i = 0; i < to_check.length(); i++) {
int raw_socket::select(basis::un_int socket, int mode, int timeout) const
{
-// FUNCDEF("select [single]");
+ FUNCDEF("select [single]");
if (!socket) return SI_ERRONEOUS;
fd_set_wrapper read_list, write_list, exceps;
int ret = inner_select(socket, mode, timeout, read_list, write_list, exceps);
void socket_minder::snoozy_select()
{
-// FUNCDEF("snoozy_select");
+ FUNCDEF("snoozy_select");
int_array read_sox;
int_array write_sox;
int_array pending;
bool socket_minder::remove_socket_data(int socket)
{
-// FUNCDEF("remove_socket_data");
+ FUNCDEF("remove_socket_data");
auto_synchronizer l(*_lock);
for (int i = 0; i < _socket_list->elements(); i++) {
if (_socket_list->borrow(i)->_socket == socket) {
sockaddr tcpip_stack::convert(const internet_address &make_from)
{
-// FUNCDEF("convert [to sockaddr]");
+ FUNCDEF("convert [to sockaddr]");
sockaddr_in new_socket; // our socket.
memset(&new_socket, 0, sizeof(new_socket)); // clear it out.
new_socket.sin_family = AF_INET;
bool tcpip_stack::resolve_any(const astring &hostname,
internet_address &to_return) const
{
-// FUNCDEF("resolve_any");
+ FUNCDEF("resolve_any");
to_return = internet_address();
if (!hostname) return false; // blank hostnames go nowhere.
astring full_host;
astring tcpip_stack::dns_resolve(const astring &hostname) const
{
-// FUNCDEF("dns_resolve");
+ FUNCDEF("dns_resolve");
if (!hostname) return ""; // blank hostnames go nowhere.
if (hostname.iequals("local") || hostname.iequals("localhost")) {
return "127.0.0.1";
void list_manager::expunge(const octopus_entity &formal(to_remove))
{
-// FUNCDEF("expunge");
+ FUNCDEF("expunge");
}
} //namespace.
outcome encryption_infoton::prepare_blowfish_key(blowfish_crypto &new_key)
{
-// FUNCDEF("prepare_blowfish_key");
+ FUNCDEF("prepare_blowfish_key");
_encrypted_blowfish_key.reset(); // clean out stuff to create.
if (!_public_key.length()) {
// wrong type of request being seen or something.
outcome encryption_infoton::extract_response(const rsa_crypto &private_key,
blowfish_crypto &new_key) const
{
-// FUNCDEF("extract_response");
+ FUNCDEF("extract_response");
if (_success != tentacle::OKAY) return _success;
byte_array decrypted;
bool worked = private_key.private_decrypt(_encrypted_blowfish_key, decrypted);
}
#ifdef DEBUG_FILE_TRANSFER_TENTACLE
LOG(astring("adding tree for: ent=") + new_record->_ent.text_form()
- + " src=" + new_record->_src_root + " dest=" + new_record->_dest_root);
+ + " src=" + new_record->_src_root);
#endif
// calculate size and checksum info for the directory.
new_record->_local_dir->calculate( !(_mode & COMPARE_CONTENT_SAMPLE) );
#ifdef DEBUG_FILE_TRANSFER_TENTACLE
LOG(astring("done adding tree for: ent=") + new_record->_ent.text_form()
- + " src=" + new_record->_src_root + " dest=" + new_record->_dest_root);
+ + " src=" + new_record->_src_root);
#endif
_correspondences->append(new_record);
outcome login_tentacle::consume(infoton &to_chow,
const octopus_request_id &item_id, byte_array &transformed)
{
-// FUNCDEF("consume");
+ FUNCDEF("consume");
transformed.reset();
security_infoton *inf = dynamic_cast<security_infoton *>(&to_chow);
if (!inf) {