Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Open sidebar
savoirfairelinux
jami-daemon
Commits
306aa133
Commit
306aa133
authored
Jul 15, 2017
by
Adrien Béraud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
namedirectory: handle 404 as "notFound" for lookupAddress
Change-Id: I1c4b059e5f058c4eb929cd38875ea06beaf6ee92
parent
a72465d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
1 deletion
+4
-1
src/ringdht/namedirectory.cpp
src/ringdht/namedirectory.cpp
+4
-1
No files found.
src/ringdht/namedirectory.cpp
View file @
306aa133
...
...
@@ -115,7 +115,8 @@ void NameDirectory::lookupAddress(const std::string& addr, LookupCallback cb)
auto
ret
=
restbed
::
Http
::
async
(
req
,
[
this
,
cb
,
addr
](
const
std
::
shared_ptr
<
restbed
::
Request
>&
,
const
std
::
shared_ptr
<
restbed
::
Response
>&
reply
)
{
if
(
reply
->
get_status_code
()
==
200
)
{
auto
code
=
reply
->
get_status_code
();
if
(
code
==
200
)
{
size_t
length
=
getContentLength
(
*
reply
);
if
(
length
>
MAX_RESPONSE_SIZE
)
{
cb
(
""
,
Response
::
error
);
...
...
@@ -142,6 +143,8 @@ void NameDirectory::lookupAddress(const std::string& addr, LookupCallback cb)
}
else
{
cb
(
""
,
Response
::
notFound
);
}
}
else
if
(
code
>=
400
&&
code
<
500
)
{
cb
(
""
,
Response
::
notFound
);
}
else
{
cb
(
""
,
Response
::
error
);
}
...
...
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