1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

RTC: Allow username is optinal

This commit is contained in:
winlin 2020-08-06 17:49:51 +08:00
parent a52a81ebb0
commit bbd51e3338

View file

@ -564,8 +564,9 @@ void SrsRtcServer::destroy(SrsRtcConnection* session)
std::map<std::string, SrsRtcConnection*>::iterator it; std::map<std::string, SrsRtcConnection*>::iterator it;
// We allows username is optional.
string username = session->username(); string username = session->username();
if ((it = map_username_session.find(username)) != map_username_session.end()) { if (!username.empty() && (it = map_username_session.find(username)) != map_username_session.end()) {
map_username_session.erase(it); map_username_session.erase(it);
} }