_sessionUserInfo tracks disconnected sessions

as well as current ones.

i.e.

/// User Info container used to store user information
/// till the end of process lifecycle - including
/// after any child session goes away

so add some info in the log to flag which ones are still connected and
which ones are not.

https: //github.com/CollaboraOnline/online/issues/8943
Signed-off-by: Caolán McNamara <caolan.mcnamara@collabora.com>
Change-Id: I5350c04d1a7bb8095464881fba97e5910f71ffb3
pull/8950/head
Caolán McNamara 2024-05-01 15:08:46 +01:00 committed by Michael Meeks
parent fcc34f061a
commit 6d00ed64d6
2 changed files with 10 additions and 1 deletions

View File

@ -1985,6 +1985,8 @@ bool Document::forwardToChild(const std::string& prefix, const std::vector<char>
_deltaGen->setSessionCount(count);
_sessionUserInfo[session->getViewId()].setDisconnected();
// No longer needed, and allow session dtor to take it.
session.reset();
return true;
@ -2349,7 +2351,8 @@ void Document::dumpState(std::ostream& oss)
<< " userId: " << it.second.getUserId()
<< " userName: " << it.second.getUserName()
<< " userExtraInfo: " << it.second.getUserExtraInfo()
<< " readOnly: " << it.second.isReadOnly();
<< " readOnly: " << it.second.isReadOnly()
<< " connected: " << it.second.isConnected();
}
oss << "\n";

View File

@ -86,6 +86,7 @@ struct UserInfo
, _userExtraInfo(userExtraInfo)
, _userPrivateInfo(userPrivateInfo)
, _readOnly(readOnly)
, _connected(true)
{
}
@ -99,12 +100,17 @@ struct UserInfo
bool isReadOnly() const { return _readOnly; }
bool isConnected() const { return _connected; }
void setDisconnected() { _connected = false; }
private:
std::string _userId;
std::string _userName;
std::string _userExtraInfo;
std::string _userPrivateInfo;
bool _readOnly;
bool _connected;
};
/// We have two types of password protected documents