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
b5884c07
Commit
b5884c07
authored
10 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
node: allow to put signed data
parent
9afbb844
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
+13
-1
13 additions, 1 deletion
tools/dhtnode.cpp
with
13 additions
and
1 deletion
tools/dhtnode.cpp
+
13
−
1
View file @
b5884c07
...
@@ -72,7 +72,7 @@ const Color::Modifier red(Color::FG_RED);
...
@@ -72,7 +72,7 @@ const Color::Modifier red(Color::FG_RED);
const
Color
::
Modifier
yellow
(
Color
::
FG_YELLOW
);
const
Color
::
Modifier
yellow
(
Color
::
FG_YELLOW
);
void
printLog
(
std
::
ostream
&
s
,
char
const
*
m
,
va_list
args
)
{
void
printLog
(
std
::
ostream
&
s
,
char
const
*
m
,
va_list
args
)
{
static
constexpr
int
BUF_SZ
=
4096
;
static
constexpr
int
BUF_SZ
=
8192
;
char
buffer
[
BUF_SZ
];
char
buffer
[
BUF_SZ
];
int
ret
=
vsnprintf
(
buffer
,
sizeof
(
buffer
),
m
,
args
);
int
ret
=
vsnprintf
(
buffer
,
sizeof
(
buffer
),
m
,
args
);
if
(
ret
<
0
)
if
(
ret
<
0
)
...
@@ -161,6 +161,8 @@ main(int argc, char **argv)
...
@@ -161,6 +161,8 @@ main(int argc, char **argv)
std
::
cout
<<
"
\t
"
<<
*
a
<<
std
::
endl
;
std
::
cout
<<
"
\t
"
<<
*
a
<<
std
::
endl
;
}
}
return
true
;
return
true
;
},
[](
bool
ok
)
{
std
::
cout
<<
"Get - done : "
<<
(
ok
?
"success"
:
"failure"
)
<<
std
::
endl
;
});
});
}
}
else
if
(
op
==
"l"
)
{
else
if
(
op
==
"l"
)
{
...
@@ -182,6 +184,16 @@ main(int argc, char **argv)
...
@@ -182,6 +184,16 @@ main(int argc, char **argv)
std
::
cout
<<
"Put done !"
<<
ok
<<
std
::
endl
;
std
::
cout
<<
"Put done !"
<<
ok
<<
std
::
endl
;
});
});
}
}
else
if
(
op
==
"s"
)
{
std
::
string
v
;
iss
>>
v
;
dht
.
putSigned
(
id
,
dht
::
Value
{
dht
::
ValueType
::
USER_DATA
.
id
,
std
::
vector
<
uint8_t
>
{
v
.
begin
(),
v
.
end
()}
},
[](
bool
ok
)
{
std
::
cout
<<
"Put signed done !"
<<
ok
<<
std
::
endl
;
});
}
else
if
(
op
==
"e"
)
{
else
if
(
op
==
"e"
)
{
std
::
string
tostr
;
std
::
string
tostr
;
std
::
string
v
;
std
::
string
v
;
...
...
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