libjsonrpccpp-devel Mailing List for libjson-rpc-cpp
Brought to you by:
cinemast
You can subscribe to this list here.
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
|
|
From: Peter Spiess-K. <de...@sp...> - 2016-11-29 21:40:08
|
Hi Jason! Sorry for the late response, I've been busy lately. First, is there a reason why you are not using the stub-generator? It usually eliminates most manual interface errors. >From the current code snippet, I cannot see any error now, but I could overlook something. Could paste the URL to the project or something that is actually compileable? This makes debugging easier. This error comes from here: https://github.com/cinemast/libjson-rpc-cpp/blob/ccbdb41388bdd929828941652da816bf52a0580e/src/jsonrpccpp/server/connectors/httpserver.cpp#L159 This means that the RPC server is not properly registered with the server connector. Greetings, Peter On 11/23/2016 09:10 PM, Jason Miesionczek wrote: > Hello, > > trying to get a basic json-rpc server up and running. Upon testing a > method, i get this error from curl: > > No client connection handler found > > Here is my code: > > #include <jsonrpccpp/server.h> > > class AbstractStubServer : public > jsonrpc::AbstractServer<AbstractStubServer> > { > public: > AbstractStubServer(jsonrpc::AbstractServerConnector &conn, > jsonrpc::serverVersion_t type = jsonrpc::JSONRPC_SERVER_V2) : > jsonrpc::AbstractServer<AbstractStubServer>(conn, type) > { > this->bindAndAddMethod(jsonrpc::Procedure("connect", > jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_STRING, > "password",jsonrpc::JSON_STRING,"uri",jsonrpc::JSON_STRING, NULL), > &AbstractStubServer::connectI); > this->bindAndAddMethod(jsonrpc::Procedure("hostGetVersion", > jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_STRING, > "connID",jsonrpc::JSON_STRING, NULL), &AbstractStubServer::hostGetVersionI); > } > > inline virtual void connectI(const Json::Value &request, > Json::Value &response) > { > response = this->connect(request["password"].asString(), > request["uri"].asString()); > } > inline virtual void hostGetVersionI(const Json::Value &request, > Json::Value &response) > { > response = this->hostGetVersion(request["connID"].asString()); > } > virtual std::string connect(const std::string& password, const > std::string& uri) = 0; > virtual std::string hostGetVersion(const std::string& connID) = 0; > }; > > using namespace jsonrpc; > using namespace std; > > class RpcServer : public AbstractStubServer > { > public: > RpcServer(AbstractServerConnector &connector, > SHRDPTR(Drivers::DriverManager) manager); > > virtual std::string connect(const std::string &password, const > std::string &uri); > virtual std::string hostGetVersion(const std::string& connID); > > private: > std::map<std::string, SHRDPTR(Drivers::IDriver)> connectionMap_; > SHRDPTR(Drivers::DriverManager) > manager_; > }; > > RpcServer::RpcServer(AbstractServerConnector &connector, > SHRDPTR(Drivers::DriverManager) manager) : > AbstractStubServer(connector), manager_(manager) > { > > } > > std::string genConnectionID(std::string uri, std::string password) > { > unsigned char result[MD5_DIGEST_LENGTH]; > MD5((unsigned char*)uri.c_str(), uri.size(), result); > > std::ostringstream sout; > sout<<std::hex<<std::setfill('0'); > for(long long c: result) > { > sout<<std::setw(2)<<(long long)c; > } > return sout.str(); > } > > std::string RpcServer::connect(const std::string &password, const > std::string &uri) > { > auto conn = MKSHRD(Connection::HypervisorConnection, uri, password); > auto factory = this->manager_->get(conn->getProtocol()); > auto driver = factory->create(conn); > auto id = genConnectionID(uri, password); > this->connectionMap_[id] = driver; > return id; > } > > std::string RpcServer::hostGetVersion(const std::string& connID) > { > auto driver = this->connectionMap_[connID]; > return driver->hostGetVersion(); > } > > and in main: > > HttpServer httpServer(8383); > RpcServer rpcServer(httpServer, manager); > rpcServer.StartListening(); > getchar(); > rpcServer.StopListening(); > > What am I missing? > > Thanks, > Jason > > > ------------------------------------------------------------------------------ > > > > _______________________________________________ > libjsonrpccpp-devel mailing list > lib...@li... > https://lists.sourceforge.net/lists/listinfo/libjsonrpccpp-devel > |
|
From: Jason M. <atm...@gm...> - 2016-11-23 20:11:05
|
Hello,
trying to get a basic json-rpc server up and running. Upon testing a
method, i get this error from curl:
No client connection handler found
Here is my code:
#include <jsonrpccpp/server.h>
class AbstractStubServer : public
jsonrpc::AbstractServer<AbstractStubServer>
{
public:
AbstractStubServer(jsonrpc::AbstractServerConnector &conn,
jsonrpc::serverVersion_t type = jsonrpc::JSONRPC_SERVER_V2) :
jsonrpc::AbstractServer<AbstractStubServer>(conn, type)
{
this->bindAndAddMethod(jsonrpc::Procedure("connect",
jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_STRING,
"password",jsonrpc::JSON_STRING,"uri",jsonrpc::JSON_STRING, NULL),
&AbstractStubServer::connectI);
this->bindAndAddMethod(jsonrpc::Procedure("hostGetVersion",
jsonrpc::PARAMS_BY_NAME, jsonrpc::JSON_STRING,
"connID",jsonrpc::JSON_STRING, NULL), &AbstractStubServer::hostGetVersionI);
}
inline virtual void connectI(const Json::Value &request,
Json::Value &response)
{
response = this->connect(request["password"].asString(),
request["uri"].asString());
}
inline virtual void hostGetVersionI(const Json::Value &request,
Json::Value &response)
{
response = this->hostGetVersion(request["connID"].asString());
}
virtual std::string connect(const std::string& password, const
std::string& uri) = 0;
virtual std::string hostGetVersion(const std::string& connID) = 0;
};
using namespace jsonrpc;
using namespace std;
class RpcServer : public AbstractStubServer
{
public:
RpcServer(AbstractServerConnector &connector,
SHRDPTR(Drivers::DriverManager) manager);
virtual std::string connect(const std::string &password, const
std::string &uri);
virtual std::string hostGetVersion(const std::string& connID);
private:
std::map<std::string, SHRDPTR(Drivers::IDriver)> connectionMap_;
SHRDPTR(Drivers::DriverManager)
manager_;
};
RpcServer::RpcServer(AbstractServerConnector &connector,
SHRDPTR(Drivers::DriverManager) manager) :
AbstractStubServer(connector), manager_(manager)
{
}
std::string genConnectionID(std::string uri, std::string password)
{
unsigned char result[MD5_DIGEST_LENGTH];
MD5((unsigned char*)uri.c_str(), uri.size(), result);
std::ostringstream sout;
sout<<std::hex<<std::setfill('0');
for(long long c: result)
{
sout<<std::setw(2)<<(long long)c;
}
return sout.str();
}
std::string RpcServer::connect(const std::string &password, const
std::string &uri)
{
auto conn = MKSHRD(Connection::HypervisorConnection, uri, password);
auto factory = this->manager_->get(conn->getProtocol());
auto driver = factory->create(conn);
auto id = genConnectionID(uri, password);
this->connectionMap_[id] = driver;
return id;
}
std::string RpcServer::hostGetVersion(const std::string& connID)
{
auto driver = this->connectionMap_[connID];
return driver->hostGetVersion();
}
and in main:
HttpServer httpServer(8383);
RpcServer rpcServer(httpServer, manager);
rpcServer.StartListening();
getchar();
rpcServer.StopListening();
What am I missing?
Thanks,
Jason
|
|
From: Peter Spiess-K. <ps...@au...> - 2016-06-16 10:04:26
|
Dear Hubert, On 06/13/2016 11:35 AM, Sokolowski, Hubert wrote: > Dear all, > > Please find a patch fixing a critical issue when handling invalid requests in the HTTP Server code. Before the fix application was crashing during security scans done by Nessus and OpenVAS vulnerability scanners. The patch was tested on 0.5.0 version and the problem is no longer observed on our side. Should apply on latest version too, but it was not tested on it. Thank you for providing the patch. It has been committed to the git repository with your author information. https://github.com/cinemast/libjson-rpc-cpp/commit/f64039fcbc3aa3a6b934d1feccf7ace3d62830cc Greetings Peter |
|
From: Sokolowski, H. <hub...@in...> - 2016-06-13 09:35:16
|
Dear all, Please find a patch fixing a critical issue when handling invalid requests in the HTTP Server code. Before the fix application was crashing during security scans done by Nessus and OpenVAS vulnerability scanners. The patch was tested on 0.5.0 version and the problem is no longer observed on our side. Should apply on latest version too, but it was not tested on it. Regards, Hubert -------------------------------------------------------------- Intel Technology Poland Slowackiego 173 80-298 Gdansk Poland This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. |
|
From: Peter Spiess-K. <ps...@au...> - 2015-01-24 10:30:13
|
Changes in v0.4.2
Fix of spelling mistakes.
Use CMAKE versioning in manpage.
Improving include scheme of jsoncpp (to fix compilation issues with
newer versions of libjsoncpp).
Bugfix in HttpServer with Threading option in SSL startup.
Greetings
Peter
|
|
From: Peter Spiess-K. <ps...@au...> - 2014-12-08 18:39:58
|
Hi Oliver! Of course it is possible. If it will get merged is a different question. Just raise th Pull-Request and I will review it. I assume you think of writing a new ClientStubGenerator subclass in the stubgenerator, right? Greetings Peter On 12/08/2014 09:25 AM, wang Oliver wrote: > Hi, List: > I am writing a C# client for the jsonrpc, is it possible to create > a pull request to your github? > Thanks. > > Best Regards > Oliver > > > ------------------------------------------------------------------------------ > Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server > from Actuate! Instantly Supercharge Your Business Reports and Dashboards > with Interactivity, Sharing, Native Excel Exports, App Integration & more > Get technology previously reserved for billion-dollar corporations, FREE > http://pubads.g.doubleclick.net/gampad/clk?id=164703151&iu=/4140/ostg.clktrk > > > _______________________________________________ > libjsonrpccpp-devel mailing list > lib...@li... > https://lists.sourceforge.net/lists/listinfo/libjsonrpccpp-devel |
|
From: wang O. <lxt...@gm...> - 2014-12-08 09:25:26
|
Hi, List:
I am writing a C# client for the jsonrpc, is it possible to create a
pull request to your github?
Thanks.
Best Regards
Oliver
|
|
From: Peter Spiess-K. <ps...@au...> - 2014-12-05 14:16:34
|
Test |