// turns a source mapping into the location that it corresponds to.
astring translate(const astring &source_path) const {
-// FUNCDEF("translate");
+ FUNCDEF("translate");
string_array pieces;
filename(source_path).separate(pieces);
astring source_mapping = pieces[0];
}
#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);
bool file_transfer_tentacle::get_differences(const octopus_entity &ent,
const astring &src, const astring &dest, filename_list &diffs)
{
-// FUNCDEF("get_differences");
+ FUNCDEF("get_differences");
diffs.reset();
AUTO_LOCK;
file_transfer_record *the_rec = _transfers->find(ent, src, dest);
int &total_files, double ¤t_size, int ¤t_files, bool &done,
time_stamp &last_active)
{
-// FUNCDEF("status");
+ FUNCDEF("status");
total_size = 0;
total_files = 0;
current_files = 0;
(_correspondences->translate(the_rec->_src_root), *the_rec->_diffs,
the_rec->_last_sent, resp->_packed_data, _maximum_transfer);
if (bufret == heavy_file_operations::FINISHED) {
- // finish by setting command to be a conclude marker.
- the_rec->_done = true;
- resp->_command = file_transfer_infoton::CONCLUDE_TRANSFER_MARKER;
- bufret = OKAY; // now it's no longer an exceptional outcome.
+ bufret = OKAY; // in either case, we don't emit a finished outcome; handled elsewhere.
+ if (!resp->_packed_data.length()) {
+ // blank packages, so finish by setting command to be a conclude marker.
+ the_rec->_done = true;
+ resp->_command = file_transfer_infoton::CONCLUDE_TRANSFER_MARKER;
+ }
} else if (bufret != OKAY) {
// complain, but still send.
LOG(astring("buffer files returned an error on item=")
outcome file_transfer_tentacle::conclude_storage_request
(file_transfer_infoton &req, const octopus_request_id &item_id)
{
- FUNCDEF("handle_storage_request");
+ FUNCDEF("conclude_storage_request");
if (_mode & ONLY_REPORT_DIFFS) {
// store an unhandled infoton.
unhandled_request *deny = new unhandled_request(item_id, req.classifier(), NO_HANDLER);
the_rec->_done = true; // we're concluding the transfer, so that's that.
resp->_request = false; // it's a response now.
store_product(resp, item_id);
+
+ LOG(astring("concluding transfer request on src=") + req._src_root + " dest="
+ + req._dest_root);
+
return common::OKAY;
}
outcome file_transfer_tentacle::conclude_storage_response
(file_transfer_infoton &resp, const octopus_request_id &item_id)
{
- FUNCDEF("handle_storage_response");
+ FUNCDEF("conclude_storage_response");
if (_mode & ONLY_REPORT_DIFFS) {
// not spoken here.
return NO_HANDLER;
// mark that we're done now.
the_rec->_done = true;
+ LOG(astring("concluding transfer response on src=") + resp._src_root + " dest="
+ + resp._dest_root);
+
// there is no response product to store.
return OKAY;
}