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
dd3c7899
Commit
dd3c7899
authored
5 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
proxy server: 0-initialize fields
parent
333087bc
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
include/opendht/callbacks.h
+3
-3
3 additions, 3 deletions
include/opendht/callbacks.h
include/opendht/dht_proxy_server.h
+5
-7
5 additions, 7 deletions
include/opendht/dht_proxy_server.h
src/dht_proxy_server.cpp
+4
-2
4 additions, 2 deletions
src/dht_proxy_server.cpp
with
12 additions
and
12 deletions
include/opendht/callbacks.h
+
3
−
3
View file @
dd3c7899
...
@@ -76,9 +76,9 @@ struct OPENDHT_PUBLIC NodeStats {
...
@@ -76,9 +76,9 @@ struct OPENDHT_PUBLIC NodeStats {
struct
OPENDHT_PUBLIC
NodeInfo
{
struct
OPENDHT_PUBLIC
NodeInfo
{
InfoHash
id
;
InfoHash
id
;
InfoHash
node_id
;
InfoHash
node_id
;
NodeStats
ipv4
;
NodeStats
ipv4
{}
;
NodeStats
ipv6
;
NodeStats
ipv6
{}
;
size_t
ongoing_ops
;
size_t
ongoing_ops
{
0
}
;
#ifdef OPENDHT_JSONCPP
#ifdef OPENDHT_JSONCPP
/**
/**
...
...
This diff is collapsed.
Click to expand it.
include/opendht/dht_proxy_server.h
+
5
−
7
View file @
dd3c7899
...
@@ -54,8 +54,6 @@ class DhtRunner;
...
@@ -54,8 +54,6 @@ class DhtRunner;
using
RestRouter
=
restinio
::
router
::
express_router_t
<>
;
using
RestRouter
=
restinio
::
router
::
express_router_t
<>
;
using
RequestStatus
=
restinio
::
request_handling_status_t
;
using
RequestStatus
=
restinio
::
request_handling_status_t
;
using
ResponseByParts
=
restinio
::
chunked_output_t
;
using
ResponseByPartsBuilder
=
restinio
::
response_builder_t
<
ResponseByParts
>
;
/**
/**
* Describes the REST API
* Describes the REST API
...
@@ -87,15 +85,15 @@ public:
...
@@ -87,15 +85,15 @@ public:
struct
ServerStats
{
struct
ServerStats
{
/** Current number of listen operations */
/** Current number of listen operations */
size_t
listenCount
;
size_t
listenCount
{
0
}
;
/** Current number of permanent put operations */
/** Current number of permanent put operations */
size_t
putCount
;
size_t
putCount
{
0
}
;
/** Current number of push tokens with at least one listen operation */
/** Current number of push tokens with at least one listen operation */
size_t
pushListenersCount
;
size_t
pushListenersCount
{
0
}
;
/** Average requests per second */
/** Average requests per second */
double
requestRate
;
double
requestRate
{
0
}
;
/** Node Info **/
/** Node Info **/
NodeInfo
nodeInfo
;
NodeInfo
nodeInfo
{}
;
std
::
string
toString
()
const
{
std
::
string
toString
()
const
{
std
::
ostringstream
ss
;
std
::
ostringstream
ss
;
...
...
This diff is collapsed.
Click to expand it.
src/dht_proxy_server.cpp
+
4
−
2
View file @
dd3c7899
...
@@ -68,6 +68,9 @@ constexpr char RESP_MSG_NO_TOKEN[] = "{\"err\":\"No token\"}";
...
@@ -68,6 +68,9 @@ constexpr char RESP_MSG_NO_TOKEN[] = "{\"err\":\"No token\"}";
constexpr
const
std
::
chrono
::
minutes
PRINT_STATS_PERIOD
{
2
};
constexpr
const
std
::
chrono
::
minutes
PRINT_STATS_PERIOD
{
2
};
using
ResponseByParts
=
restinio
::
chunked_output_t
;
using
ResponseByPartsBuilder
=
restinio
::
response_builder_t
<
ResponseByParts
>
;
class
opendht_logger_t
class
opendht_logger_t
{
{
public:
public:
...
@@ -1003,7 +1006,6 @@ DhtProxyServer::put(restinio::request_handle_t request,
...
@@ -1003,7 +1006,6 @@ DhtProxyServer::put(restinio::request_handle_t request,
if
(
pput
.
expireNotifyTimer
)
if
(
pput
.
expireNotifyTimer
)
pput
.
expireNotifyTimer
->
expires_at
(
timeout
-
proxy
::
OP_MARGIN
);
pput
.
expireNotifyTimer
->
expires_at
(
timeout
-
proxy
::
OP_MARGIN
);
}
}
lock
.
unlock
();
}
}
dht_
->
put
(
infoHash
,
value
,
[
this
,
request
,
value
](
bool
ok
){
dht_
->
put
(
infoHash
,
value
,
[
this
,
request
,
value
](
bool
ok
){
if
(
ok
){
if
(
ok
){
...
...
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