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:
parent
a52a81ebb0
commit
bbd51e3338
1 changed files with 2 additions and 1 deletions
|
@ -564,8 +564,9 @@ void SrsRtcServer::destroy(SrsRtcConnection* session)
|
|||
|
||||
std::map<std::string, SrsRtcConnection*>::iterator it;
|
||||
|
||||
// We allows username is optional.
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue