mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-15 12:51:00 +02:00
Add thread-local storage of rpc username
This commit is contained in:
parent
c87debb048
commit
ce43197c11
4 changed files with 19 additions and 1 deletions
|
|
@ -176,6 +176,14 @@ static bool HTTPReq_JSONRPC(HTTPRequest* req, const std::string &)
|
|||
return false;
|
||||
}
|
||||
|
||||
//Set thread-local storage variable to RPC user name for logging
|
||||
std::string strUserPass64 = authHeader.second.substr(6);
|
||||
boost::trim(strUserPass64);
|
||||
std::string strUserPass = DecodeBase64(strUserPass64);
|
||||
if (!userInstance.get()) {
|
||||
userInstance.reset(new std::string(strUserPass.substr(0, strUserPass.find(":"))));
|
||||
}
|
||||
|
||||
try {
|
||||
// Parse request
|
||||
UniValue valRequest;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue