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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
savoirfairelinux
opendht
Commits
1ed45cdc
Commit
1ed45cdc
authored
3 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
c: support log to stdout/stderr
parent
c40ba83c
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
c/opendht.cpp
+9
-2
9 additions, 2 deletions
c/opendht.cpp
c/opendht_c.h
+1
-0
1 addition, 0 deletions
c/opendht_c.h
with
10 additions
and
2 deletions
c/opendht.cpp
+
9
−
2
View file @
1ed45cdc
...
...
@@ -17,7 +17,9 @@
*/
#include
"opendht_c.h"
#include
"opendht.h"
#include
<opendht.h>
#include
<opendht/log.h>
using
ValueSp
=
std
::
shared_ptr
<
dht
::
Value
>
;
using
PrivkeySp
=
std
::
shared_ptr
<
dht
::
crypto
::
PrivateKey
>
;
...
...
@@ -333,7 +335,12 @@ int dht_runner_run_config(dht_runner* r, in_port_t port, const dht_runner_config
config
.
push_token
=
conf
->
push_token
?
std
::
string
(
conf
->
push_token
)
:
std
::
string
{};
config
.
peer_discovery
=
conf
->
peer_discovery
;
config
.
peer_publish
=
conf
->
peer_publish
;
runner
->
run
(
port
,
config
);
dht
::
DhtRunner
::
Context
context
;
if
(
conf
->
log
)
{
context
.
logger
=
dht
::
log
::
getStdLogger
();
}
runner
->
run
(
port
,
config
,
std
::
move
(
context
));
}
catch
(...)
{
return
ENOTCONN
;
}
...
...
This diff is collapsed.
Click to expand it.
c/opendht_c.h
+
1
−
0
View file @
1ed45cdc
...
...
@@ -147,6 +147,7 @@ struct OPENDHT_PUBLIC dht_runner_config {
bool
peer_publish
;
dht_certificate
*
server_ca
;
dht_identity
client_identity
;
bool
log
;
};
typedef
struct
dht_runner_config
dht_runner_config
;
OPENDHT_C_PUBLIC
void
dht_runner_config_default
(
dht_runner_config
*
config
);
...
...
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