Commit 1de22c45 authored by Steven Murray's avatar Steven Murray
Browse files

RequestMessage::processCLOSEW() now calls m_scheduler.queueArchiveWithGivenId()

parent 138f7810
......@@ -409,18 +409,23 @@ void RequestMessage::processCLOSEW(const cta::eos::Notification &notification, c
request.creationLog.username = m_cliIdentity.username;
request.creationLog.time = time(nullptr);
// Queue the request
// CTA Archive ID is an EOS extended attribute, i.e. it is stored as a string, which
// must be converted to a valid uint64_t
uint64_t archiveFileId = m_scheduler.queueArchive(m_cliIdentity.username, request, m_lc);
const auto archiveFileIdItor = notification.file().xattr().find("CTA_ArchiveFileId");
if(notification.file().xattr().end() == archiveFileIdItor) {
throw PbException(std::string(__FUNCTION__) + ": Failed to find the extended attribute named CTA_ArchiveFileId");
}
const std::string archiveFileIdStr = archiveFileIdItor->second;
uint64_t archiveFileId = 0;
if((archiveFileId = strtoul(archiveFileIdStr.c_str(), nullptr, 10)) == 0)
{
throw PbException("Invalid archiveFileID " + archiveFileIdStr);
}
// Set archiveFileId in response (deprecated)
// Queue the request
std::string result_str = "<eos::wfe::path::fxattr:sys.archiveFileId>" + std::to_string(archiveFileId);
#ifdef XRDSSI_DEBUG
std::cerr << result_str << std::endl;
#endif
response.set_message_txt(result_str);
response.mutable_xattr()->insert(google::protobuf::MapPair<std::string,std::string>("CTA_ArchiveFileId", std::to_string(archiveFileId)));
m_scheduler.queueArchiveWithGivenId(archiveFileId, m_cliIdentity.username, request, m_lc);
// Set response type
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment