From: Chris Koeritz Date: Tue, 18 Sep 2012 19:36:04 +0000 (-0400) Subject: stupid stumbling over own feet, but seems better now. X-Git-Tag: 2.140.90~1223 X-Git-Url: https://feistymeow.org/gitweb/?a=commitdiff_plain;h=ab871f11081cec310c2e51a7d3b7ca148b1a99f6;p=feisty_meow.git stupid stumbling over own feet, but seems better now. --- diff --git a/octopi/library/tentacles/file_transfer_tentacle.cpp b/octopi/library/tentacles/file_transfer_tentacle.cpp index 877672b1..23eee9de 100644 --- a/octopi/library/tentacles/file_transfer_tentacle.cpp +++ b/octopi/library/tentacles/file_transfer_tentacle.cpp @@ -620,10 +620,12 @@ outcome file_transfer_tentacle::handle_storage_request (_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=") diff --git a/octopi/library/tentacles/recursive_file_copy.cpp b/octopi/library/tentacles/recursive_file_copy.cpp index a159c41c..0b33269f 100644 --- a/octopi/library/tentacles/recursive_file_copy.cpp +++ b/octopi/library/tentacles/recursive_file_copy.cpp @@ -165,6 +165,12 @@ outcome recursive_file_copy::copy_hierarchy(int transfer_mode, if (!reply) RETURN_ERROR_RFC("failed to get ongoing transfer reply", NONE_READY); + if (reply->_command == file_transfer_infoton::CONCLUDE_TRANSFER_MARKER) { + BASE_LOG(astring("finished transfer from \"") + source_dir + + "\" to \"" + target_dir + "\""); + break; + } + byte_array copy = reply->_packed_data; while (copy.length()) { file_time empty; @@ -178,18 +184,11 @@ outcome recursive_file_copy::copy_hierarchy(int transfer_mode, //hmmm: this needs better formatting, and should not repeat the same file name even // if it's in multiple chunks. -//hmmm: if logging, then... BASE_LOG(head.readable_text_form()); } if (copy.length()) RETURN_ERROR_RFC("still had data in array", GARBAGE); - if (reply->_command == file_transfer_infoton::CONCLUDE_TRANSFER_MARKER) { - BASE_LOG(astring("finished transfer from \"") + source_dir - + "\" to \"" + target_dir + "\""); - break; - } - octopus_request_id resp_id(ent, iter + 11); outcome resp_ret = client_spider.evaluate(reply, resp_id); if (resp_ret != tentacle::OKAY)