Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
opendht
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Model registry
Analyze
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
opendht
Commits
5c4a68cc
Commit
5c4a68cc
authored
10 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
dhtnode: fix error message
parent
38265d58
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
tools/dhtnode.cpp
+10
-3
10 additions, 3 deletions
tools/dhtnode.cpp
with
10 additions
and
3 deletions
tools/dhtnode.cpp
+
10
−
3
View file @
5c4a68cc
...
...
@@ -41,6 +41,7 @@ extern "C" {
#include
<string>
#include
<sstream>
#include
<chrono>
#include
<set>
using
namespace
dht
;
...
...
@@ -196,7 +197,16 @@ main(int argc, char **argv)
continue
;
}
if
(
op
.
empty
())
continue
;
dht
::
InfoHash
id
{
idstr
};
static
const
std
::
set
<
std
::
string
>
VALID_OPS
{
"g"
,
"l"
,
"p"
,
"s"
,
"e"
,
"a"
};
if
(
VALID_OPS
.
find
(
op
)
==
VALID_OPS
.
cend
())
{
std
::
cout
<<
"Unknown command: "
<<
op
<<
std
::
endl
;
std
::
cout
<<
" (type 'h' or 'help' for a list of possible commands)"
<<
std
::
endl
;
continue
;
}
static
constexpr
dht
::
InfoHash
INVALID_ID
{};
if
(
id
==
INVALID_ID
)
{
std
::
cout
<<
"Syntax error: invalid InfoHash."
<<
std
::
endl
;
...
...
@@ -261,9 +271,6 @@ main(int argc, char **argv)
dht
.
put
(
id
,
dht
::
Value
{
dht
::
ServiceAnnouncement
::
TYPE
.
id
,
dht
::
ServiceAnnouncement
(
port
)},
[](
bool
ok
)
{
std
::
cout
<<
"Announce done !"
<<
ok
<<
std
::
endl
;
});
}
else
if
(
op
!=
""
)
{
std
::
cout
<<
"Unknown command: "
<<
op
<<
std
::
endl
;
std
::
cout
<<
" (type 'h' or 'help' for a list of possible commands)"
<<
std
::
endl
;
}
}
...
...
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