+outcome file_transfer_tentacle::conclude_storage_request
+ (file_transfer_infoton &req, const octopus_request_id &item_id)
+{
+ 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);
+ store_product(deny, item_id);
+ return NO_HANDLER;
+ }
+
+ // look up the transfer record.
+ file_transfer_record *the_rec = _transfers->find(item_id._entity,
+ req._src_root, req._dest_root);
+ if (!the_rec) {
+ LOG(astring("could not find the record for this transfer: item=")
+ + item_id.text_form() + " src=" + req._src_root + " dest="
+ + req._dest_root);
+ return NOT_FOUND; // not registered, so reject it.
+ }
+
+ the_rec->_last_active.reset(); // mark it as still active.
+
+ file_transfer_infoton *resp = dynamic_cast<file_transfer_infoton *>(req.clone());
+
+ if (!the_rec->_diffs) return BAD_INPUT; // wrong type of object.
+
+ 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("conclude_storage_response");
+ if (_mode & ONLY_REPORT_DIFFS) {
+ // not spoken here.
+ return NO_HANDLER;
+ }
+
+ // look up the transfer record.
+ file_transfer_record *the_rec = _transfers->find(item_id._entity,
+ resp._src_root, resp._dest_root);
+ if (!the_rec) return NOT_FOUND; // not registered, so reject it.
+
+ the_rec->_last_active.reset(); // mark it as still active.
+
+ // 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;
+}
+
+// consume() is the only method that is allowed to invoke the "handle_X" methods