[cpp-sp] branch master updated: Add application ID to NDC when available.
Scott Cantor
cantor.2 at osu.edu
Fri Apr 20 14:30:04 EDT 2018
This is an automated email from the git hooks/post-receive script.
scantor pushed a commit to branch master
in repository cpp-sp.
View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=eb566775d2e8e0ead97792382e38216db4a74bff
The following commit(s) were added to refs/heads/master by this push:
new eb56677 Add application ID to NDC when available.
eb56677 is described below
commit eb566775d2e8e0ead97792382e38216db4a74bff
Author: Scott Cantor <cantor.2 at osu.edu>
AuthorDate: Fri Apr 20 14:29:58 2018 -0400
Add application ID to NDC when available.
---
shibsp/remoting/impl/SocketListener.cpp | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
diff --git a/shibsp/remoting/impl/SocketListener.cpp b/shibsp/remoting/impl/SocketListener.cpp
index 132579b..51dfd0c 100644
--- a/shibsp/remoting/impl/SocketListener.cpp
+++ b/shibsp/remoting/impl/SocketListener.cpp
@@ -33,6 +33,7 @@
#include <errno.h>
#include <stack>
#include <sstream>
+#include <boost/lexical_cast.hpp>
#include <xercesc/util/XMLUniDefs.hpp>
#include <xmltooling/util/NDC.h>
@@ -49,7 +50,9 @@
using namespace shibsp;
using namespace xmltooling;
using namespace std;
+
using xercesc::DOMElement;
+using boost::lexical_cast;
namespace shibsp {
@@ -429,9 +432,7 @@ ServerThread::ServerThread(SocketListener::ShibSocket& s, SocketListener* listen
: m_sock(s), m_child(nullptr), m_listener(listener)
{
- ostringstream buf;
- buf << "[" << id << "]";
- m_id = buf.str();
+ m_id = string("[") + lexical_cast<string>(id) + "]";
// Create the child thread
m_child = Thread::create(server_thread_fn, (void*)this, m_listener->m_stackSize);
@@ -539,6 +540,12 @@ int ServerThread::job()
DDFJanitor jin(in);
is >> in;
+ string appid;
+ const char* aid = in["application_id"].string();
+ if (aid)
+ appid = string("[") + aid + "]";
+ NDC ndc(appid);
+
log.debug("dispatching message (%s)", in.name() ? in.name() : "unnamed");
incomingError = false;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list