Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-daemon
Commits
d984aa86
Commit
d984aa86
authored
Aug 28, 2013
by
Emmanuel Lepage Vallee
Browse files
[ #14268 ] daemon: Fix a race hash collision when creating new accounts too fast
parent
8866f608
Changes
1
Hide whitespace changes
Inline
Side-by-side
daemon/src/managerimpl.cpp
View file @
d984aa86
...
...
@@ -2465,9 +2465,14 @@ ManagerImpl::addAccount(const std::map<std::string, std::string>& details)
/** @todo Deal with both the accountMap_ and the Configuration */
std
::
stringstream
accountID
;
std
::
string
accountList
(
preferences
.
getAccountOrder
());
accountID
<<
"Account:"
<<
time
(
NULL
);
std
::
string
newAccountID
(
accountID
.
str
());
while
(
accountList
.
find
(
newAccountID
)
!=
std
::
string
::
npos
)
{
newAccountID
+=
"1"
;
}
// Get the type
std
::
string
accountType
;
...
...
@@ -2500,9 +2505,8 @@ ManagerImpl::addAccount(const std::map<std::string, std::string>& details)
newAccount
->
setAccountDetails
(
details
);
// Add the newly created account in the account order list
std
::
string
accountList
(
preferences
.
getAccountOrder
());
// Add the newly created account in the account order list
newAccountID
+=
"/"
;
if
(
not
accountList
.
empty
())
{
// Prepend the new account
...
...
@@ -2521,7 +2525,7 @@ ManagerImpl::addAccount(const std::map<std::string, std::string>& details)
client_
.
getConfigurationManager
()
->
accountsChanged
();
return
a
ccountID
.
str
()
;
return
newA
ccountID
;
}
void
ManagerImpl
::
removeAccount
(
const
std
::
string
&
accountID
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment