mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-19 13:27:35 +02:00
Add thread-local storage of rpc username
This commit is contained in:
parent
85be0821fa
commit
5412a584f4
4 changed files with 19 additions and 1 deletions
|
|
@ -172,6 +172,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(":"))));
|
||||
}
|
||||
|
||||
JSONRequest jreq;
|
||||
try {
|
||||
// Parse request
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue