fix bug: session: multiple bsessionids (for different paths) lead to login failure

This commit is contained in:
jie 2021-11-26 22:01:21 +08:00
parent 56ca972d19
commit fb3c96da6a
1 changed files with 2 additions and 3 deletions

View File

@ -61,10 +61,9 @@ namespace bserv {
int_to_str_.erase(another_key);
queue_.erase(queue_.begin());
}
bool found = true;
std::size_t int_key;
if (key.empty() || str_to_int_.count(key) == 0) {
found = false;
return false;
}
else {
int_key = str_to_int_[key];
@ -79,7 +78,7 @@ namespace bserv {
// pushes expiry-key tuple (pair) to the queue
queue_.emplace(expiry_[int_key], int_key);
session_ptr = sessions_[int_key];
return found;
return true;
}
} // bserv