File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -27,10 +27,10 @@ class CppHttpLibServerConnector {
27
27
server(server),
28
28
httpServer(),
29
29
port(port) {
30
- httpServer.Post (" /jsonrpc" , [&]( const httplib::Request &req, httplib::Response &res) {
31
- res. status = 200 ;
32
- res. set_content (server. HandleRequest ( req. body ), " application/json " );
33
- });
30
+ httpServer.Post (" /jsonrpc" ,
31
+ [ this ]( const httplib::Request &req, httplib::Response &res) {
32
+ this -> PostAction ( req, res );
33
+ });
34
34
}
35
35
36
36
virtual ~CppHttpLibServerConnector () { StopListening (); }
@@ -54,4 +54,10 @@ class CppHttpLibServerConnector {
54
54
jsonrpccxx::JsonRpcServer &server;
55
55
httplib::Server httpServer;
56
56
int port;
57
+
58
+ void PostAction (const httplib::Request &req,
59
+ httplib::Response &res) {
60
+ res.status = 200 ;
61
+ res.set_content (this ->server .HandleRequest (req.body ), " application/json" );
62
+ }
57
63
};
You can’t perform that action at this time.
0 commit comments