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
166b5e35
Commit
166b5e35
authored
5 years ago
by
Seva
Committed by
Adrien Béraud
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
proxyserver: default push to localhost if empty host
parent
77356b05
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/opendht/dht_proxy_server.h
+1
-1
1 addition, 1 deletion
include/opendht/dht_proxy_server.h
src/dht_proxy_server.cpp
+10
-4
10 additions, 4 deletions
src/dht_proxy_server.cpp
with
11 additions
and
5 deletions
include/opendht/dht_proxy_server.h
+
1
−
1
View file @
166b5e35
...
...
@@ -360,7 +360,7 @@ private:
mutable
std
::
atomic
<
size_t
>
requestNum_
{
0
};
mutable
std
::
atomic
<
time_point
>
lastStatsReset_
{
time_point
::
min
()};
const
std
::
string
pushServer_
;
std
::
string
pushServer_
;
#ifdef OPENDHT_PUSH_NOTIFICATIONS
struct
Listener
{
...
...
This diff is collapsed.
Click to expand it.
src/dht_proxy_server.cpp
+
10
−
4
View file @
166b5e35
...
...
@@ -222,6 +222,16 @@ DhtProxyServer::DhtProxyServer(
jsonBuilder_
[
"commentStyle"
]
=
"None"
;
jsonBuilder_
[
"indentation"
]
=
""
;
if
(
!
pushServer
.
empty
()){
// no host delim, assume port only
if
(
pushServer
.
find
(
":"
)
==
std
::
string
::
npos
)
pushServer_
=
"localhost:"
+
pushServer_
;
// define http request destination for push notifications
pushHostPort_
=
splitPort
(
pushServer_
);
if
(
logger_
)
logger_
->
d
(
"Using push server for notifications: %s:%s"
,
pushHostPort_
.
first
.
c_str
(),
pushHostPort_
.
second
.
c_str
());
}
if
(
identity
.
first
and
identity
.
second
)
{
asio
::
error_code
ec
;
// define tls context
...
...
@@ -258,8 +268,6 @@ DhtProxyServer::DhtProxyServer(
restinio
::
own_io_context
(),
std
::
forward
<
restinio
::
run_on_this_thread_settings_t
<
RestRouterTraitsTls
>>
(
std
::
move
(
settings
))
);
// define http request destination
pushHostPort_
=
splitPort
(
pushServer_
);
// run http server
serverThread_
=
std
::
thread
([
this
]{
httpsServer_
->
open_async
([]{
/*ok*/
},
[](
std
::
exception_ptr
ex
){
...
...
@@ -276,8 +284,6 @@ DhtProxyServer::DhtProxyServer(
restinio
::
own_io_context
(),
std
::
forward
<
restinio
::
run_on_this_thread_settings_t
<
RestRouterTraits
>>
(
std
::
move
(
settings
))
);
// define http request destination
pushHostPort_
=
splitPort
(
pushServer_
);
// run http server
serverThread_
=
std
::
thread
([
this
](){
httpServer_
->
open_async
([]{
/*ok*/
},
[](
std
::
exception_ptr
ex
){
...
...
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