Support paths for subscribe via json-rpc.

This commit is contained in:
Arthur Britto
2012-12-30 17:16:53 -08:00
parent bea23a6372
commit 937f9718f8
6 changed files with 12 additions and 14 deletions

View File

@@ -10,9 +10,8 @@ RPCSub::RPCSub(const std::string& strUrl, const std::string& strUsername, const
: mUrl(strUrl), mUsername(strUsername), mPassword(strPassword)
{
std::string strScheme;
std::string strPath;
if (!parseUrl(strUrl, strScheme, mIp, mPort, strPath))
if (!parseUrl(strUrl, strScheme, mIp, mPort, mPath))
{
throw std::runtime_error("Failed to parse url.");
}
@@ -20,11 +19,6 @@ RPCSub::RPCSub(const std::string& strUrl, const std::string& strUsername, const
{
throw std::runtime_error("Only http is supported.");
}
else if (!strPath.empty())
{
// XXX FIXME: support path
throw std::runtime_error("Only empty path is supported.");
}
mSeq = 1;
}
@@ -64,7 +58,7 @@ void RPCSub::sendThread()
// Drop result.
try
{
(void) callRPC(mIp, mPort, mUsername, mPassword, "event", jvEvent);
(void) callRPC(mIp, mPort, mUsername, mPassword, mPath, "event", jvEvent);
}
catch (const std::exception& e)
{