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
414e0a2e
Commit
414e0a2e
authored
5 years ago
by
Adrien Béraud
Browse files
Options
Downloads
Patches
Plain Diff
proxy server: move type traits definition to cpp
parent
e0393ff8
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
+7
-22
7 additions, 22 deletions
include/opendht/dht_proxy_server.h
src/dht_proxy_server.cpp
+21
-0
21 additions, 0 deletions
src/dht_proxy_server.cpp
with
28 additions
and
22 deletions
include/opendht/dht_proxy_server.h
+
7
−
22
View file @
414e0a2e
...
@@ -52,28 +52,6 @@ namespace restinio {
...
@@ -52,28 +52,6 @@ namespace restinio {
struct
custom_http_methods_t
;
struct
custom_http_methods_t
;
}
}
using
RestRouter
=
restinio
::
router
::
express_router_t
<>
;
struct
RestRouterTraitsTls
:
public
restinio
::
default_tls_traits_t
{
using
timer_manager_t
=
restinio
::
asio_timer_manager_t
;
using
http_methods_mapper_t
=
restinio
::
custom_http_methods_t
;
using
logger_t
=
restinio
::
opendht_logger_t
;
using
request_handler_t
=
RestRouter
;
using
connection_state_listener_t
=
http
::
ConnectionListener
;
};
struct
RestRouterTraits
:
public
restinio
::
default_traits_t
{
using
timer_manager_t
=
restinio
::
asio_timer_manager_t
;
using
http_methods_mapper_t
=
restinio
::
custom_http_methods_t
;
using
logger_t
=
restinio
::
opendht_logger_t
;
using
request_handler_t
=
RestRouter
;
using
connection_state_listener_t
=
http
::
ConnectionListener
;
};
using
RequestStatus
=
restinio
::
request_handling_status_t
;
using
ResponseByParts
=
restinio
::
chunked_output_t
;
using
ResponseByPartsBuilder
=
restinio
::
response_builder_t
<
ResponseByParts
>
;
namespace
Json
{
namespace
Json
{
class
Value
;
class
Value
;
}
}
...
@@ -82,6 +60,13 @@ namespace dht {
...
@@ -82,6 +60,13 @@ namespace dht {
class
DhtRunner
;
class
DhtRunner
;
using
RestRouter
=
restinio
::
router
::
express_router_t
<>
;
struct
RestRouterTraitsTls
;
struct
RestRouterTraits
;
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
*/
*/
...
...
This diff is collapsed.
Click to expand it.
src/dht_proxy_server.cpp
+
21
−
0
View file @
414e0a2e
...
@@ -46,6 +46,27 @@ constexpr char RESP_MSG_PUT_FAILED[] = "{\"err\":\"Put failed\"}";
...
@@ -46,6 +46,27 @@ constexpr char RESP_MSG_PUT_FAILED[] = "{\"err\":\"Put failed\"}";
constexpr
const
std
::
chrono
::
minutes
PRINT_STATS_PERIOD
{
2
};
constexpr
const
std
::
chrono
::
minutes
PRINT_STATS_PERIOD
{
2
};
struct
RestRouterTraitsTls
:
public
restinio
::
default_tls_traits_t
{
using
timer_manager_t
=
restinio
::
asio_timer_manager_t
;
#ifdef OPENDHT_PROXY_HTTP_PARSER_FORK
using
http_methods_mapper_t
=
restinio
::
custom_http_methods_t
;
#endif
using
logger_t
=
restinio
::
opendht_logger_t
;
using
request_handler_t
=
RestRouter
;
using
connection_state_listener_t
=
http
::
ConnectionListener
;
};
struct
RestRouterTraits
:
public
restinio
::
default_traits_t
{
using
timer_manager_t
=
restinio
::
asio_timer_manager_t
;
#ifdef OPENDHT_PROXY_HTTP_PARSER_FORK
using
http_methods_mapper_t
=
restinio
::
custom_http_methods_t
;
#endif
using
logger_t
=
restinio
::
opendht_logger_t
;
using
request_handler_t
=
RestRouter
;
using
connection_state_listener_t
=
http
::
ConnectionListener
;
};
DhtProxyServer
::
DhtProxyServer
(
DhtProxyServer
::
DhtProxyServer
(
std
::
shared_ptr
<
dht
::
crypto
::
Identity
>
identity
,
std
::
shared_ptr
<
dht
::
crypto
::
Identity
>
identity
,
std
::
shared_ptr
<
DhtRunner
>
dht
,
in_port_t
port
,
const
std
::
string
&
pushServer
,
std
::
shared_ptr
<
DhtRunner
>
dht
,
in_port_t
port
,
const
std
::
string
&
pushServer
,
...
...
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