assert(chain.first->key->domain == pident->domain); // NOLINT
// don't chain onto existing chained waiter or a chain already processed
if (chain.first->key->fd > -1 && !chain.first->key->closed) {
- *fileDesc = -1; // gets used in waitEvent / sendEvent later on
auto currentChainSize = chain.first->key->authReqChain.size();
+ *fileDesc = -static_cast<int>(currentChainSize + 1); // value <= -1, gets used in waitEvent / sendEvent later on
if (g_maxChainLength > 0 && currentChainSize >= g_maxChainLength) {
- return LWResult::Result::OSLimitError;
+ return LWResult::Result::ChainLimitError;
}
assert(uSec(chain.first->key->creationTime) != 0); // NOLINT
auto age = now - chain.first->key->creationTime;
if (uSec(age) > static_cast<uint64_t>(1000) * authWaitTimeMSec(g_multiTasker) * 2 / 3) {
- return LWResult::Result::OSLimitError;
+ return LWResult::Result::ChainLimitError;
}
- chain.first->key->authReqChain.insert(qid); // we can chain
+ chain.first->key->authReqChain.emplace(*fileDesc, qid); // we can chain
auto maxLength = t_Counters.at(rec::Counter::maxChainLength);
if (currentChainSize > maxLength) {
t_Counters.at(rec::Counter::maxChainLength) = currentChainSize;