made the path for games a bit nicer, going one level down into subdirs
[feisty_meow.git] / octopi / library / tentacles / file_transfer_tentacle.cpp
index 23eee9de193ad5afb992e539d39c3e713d430049..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>
@@ -138,7 +139,8 @@ public:
   astring translate(const astring &source_path) const {
     FUNCDEF("translate");
     string_array pieces;
-    filename(source_path).separate(pieces);
+    bool rooted;
+    filename(source_path).separate(rooted, pieces);
     astring source_mapping = pieces[0];
     pieces.zap(0, 0);  // remove source part.
 
@@ -273,14 +275,14 @@ outcome file_transfer_tentacle::add_correspondence
   }
 #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);
@@ -466,13 +468,14 @@ outcome file_transfer_tentacle::handle_tree_compare_request
   // get the mapping from the specified location on this side.
   filename splitting(req._src_root);
   string_array pieces;
-  splitting.separate(pieces);
+  bool rooted;
+  splitting.separate(rooted, pieces);
   astring source_mapping = pieces[0];
 
   // patch the name up to find the sub_path for the source.
   filename source_start;
   pieces.zap(0, 0);
-  source_start.join(pieces);
+  source_start.join(rooted, pieces);
 
   // locate the allowed transfer depot for the mapping they provided.
   file_transfer_record *mapping_record
@@ -556,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;
 }
 
@@ -698,6 +705,7 @@ outcome file_transfer_tentacle::handle_storage_response
 
     astring full_file = resp._dest_root + filename::default_separator()
         + recorded_info->secondary();
+LOG(astring("telling it to write to fullfile: ") + full_file);
 
     outcome ret = heavy_file_operations::write_file_chunk(full_file,
         found._byte_start, to_write);