Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
jami-daemon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
jami-daemon
Commits
25a6bd3f
Commit
25a6bd3f
authored
Sep 9, 2019
by
Adrien Béraud
Committed by
Sébastien Blin
Sep 10, 2019
Browse files
Options
Downloads
Patches
Plain Diff
namedirectory: don't create temporary items during lookup
Change-Id: Icc3c9fd79c01641d8280eff0ffccf8dfe889d1a7
parent
9f249126
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/jamidht/namedirectory.cpp
+3
-0
3 additions, 0 deletions
src/jamidht/namedirectory.cpp
src/jamidht/namedirectory.h
+1
-1
1 addition, 1 deletion
src/jamidht/namedirectory.h
with
4 additions
and
1 deletion
src/jamidht/namedirectory.cpp
+
3
−
0
View file @
25a6bd3f
...
@@ -109,6 +109,9 @@ NameDirectory::instance(const std::string& server, std::shared_ptr<dht::Logger>
...
@@ -109,6 +109,9 @@ NameDirectory::instance(const std::string& server, std::shared_ptr<dht::Logger>
std
::
lock_guard
<
std
::
mutex
>
lock
(
instanceMtx
);
std
::
lock_guard
<
std
::
mutex
>
lock
(
instanceMtx
);
static
std
::
map
<
std
::
string
,
NameDirectory
>
instances
{};
static
std
::
map
<
std
::
string
,
NameDirectory
>
instances
{};
auto
it
=
instances
.
find
(
s
);
if
(
it
!=
instances
.
end
())
return
it
->
second
;
auto
r
=
instances
.
emplace
(
std
::
piecewise_construct
,
auto
r
=
instances
.
emplace
(
std
::
piecewise_construct
,
std
::
forward_as_tuple
(
s
),
std
::
forward_as_tuple
(
s
),
std
::
forward_as_tuple
(
s
,
l
));
std
::
forward_as_tuple
(
s
,
l
));
...
...
This diff is collapsed.
Click to expand it.
src/jamidht/namedirectory.h
+
1
−
1
View file @
25a6bd3f
...
@@ -60,7 +60,6 @@ public:
...
@@ -60,7 +60,6 @@ public:
using
LookupCallback
=
std
::
function
<
void
(
const
std
::
string
&
result
,
Response
response
)
>
;
using
LookupCallback
=
std
::
function
<
void
(
const
std
::
string
&
result
,
Response
response
)
>
;
using
RegistrationCallback
=
std
::
function
<
void
(
RegistrationResponse
response
)
>
;
using
RegistrationCallback
=
std
::
function
<
void
(
RegistrationResponse
response
)
>
;
NameDirectory
()
{}
NameDirectory
(
const
std
::
string
&
s
,
std
::
shared_ptr
<
dht
::
Logger
>
l
=
{});
NameDirectory
(
const
std
::
string
&
s
,
std
::
shared_ptr
<
dht
::
Logger
>
l
=
{});
void
load
();
void
load
();
...
@@ -84,6 +83,7 @@ public:
...
@@ -84,6 +83,7 @@ public:
private
:
private
:
NON_COPYABLE
(
NameDirectory
);
NON_COPYABLE
(
NameDirectory
);
NameDirectory
(
NameDirectory
&&
)
=
delete
;
NameDirectory
(
NameDirectory
&&
)
=
delete
;
NameDirectory
&
operator
=
(
NameDirectory
&&
)
=
delete
;
constexpr
static
const
char
*
const
DEFAULT_SERVER_HOST
=
"ns.jami.net"
;
constexpr
static
const
char
*
const
DEFAULT_SERVER_HOST
=
"ns.jami.net"
;
const
std
::
string
serverHost_
{
DEFAULT_SERVER_HOST
};
const
std
::
string
serverHost_
{
DEFAULT_SERVER_HOST
};
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment