Revise url subscribe username and password API

This commit is contained in:
Arthur Britto
2013-03-12 11:41:04 -07:00
parent 1aef1ca4f6
commit d5c52df10d
2 changed files with 12 additions and 2 deletions

View File

@@ -10,3 +10,5 @@ Critical protocol changes
** "closeTime" DEPRECATED: use "close" or "close_human"
* stream "rt_accounts" --> "accounts_proposed"
* stream "rt_transactions" --> "transactions_proposed"
* subscribe "username" --> "url_username"
* subscribe "password" --> "url_password"

View File

@@ -2639,8 +2639,16 @@ Json::Value RPCHandler::doSubscribe(Json::Value jvRequest, int& cost)
return rpcError(rpcNO_PERMISSION);
std::string strUrl = jvRequest["url"].asString();
std::string strUsername = jvRequest.isMember("username") ? jvRequest["username"].asString() : "";
std::string strPassword = jvRequest.isMember("password") ? jvRequest["password"].asString() : "";
std::string strUsername = jvRequest.isMember("url_username") ? jvRequest["url_username"].asString() : "";
std::string strPassword = jvRequest.isMember("url_password") ? jvRequest["url_password"].asString() : "";
// DEPRICATED
if (jvRequest.isMember("username"))
strUsername = jvRequest["username"].asString();
// DEPRICATED
if (jvRequest.isMember("password"))
strPassword = jvRequest["password"].asString();
ispSub = mNetOps->findRpcSub(strUrl);
if (!ispSub)