Introduce user getter to avoid null pointers

This commit is contained in:
instagibbs 2016-04-28 14:47:07 -04:00 committed by Gregory Sanders
parent 2f5d051394
commit 2a34dbdaa5
3 changed files with 7 additions and 1 deletions

View file

@ -30,6 +30,10 @@
//Thread local rpc user name for logging purposes
boost::thread_specific_ptr<std::string> userInstance;
std::string getUser() {
return (userInstance.get() ? *userInstance.get() : "UNDEFINED_USER");
}
using namespace RPCServer;
using namespace std;