diff options
| author | Ted Ross <tross@apache.org> | 2009-02-24 14:15:28 +0000 |
|---|---|---|
| committer | Ted Ross <tross@apache.org> | 2009-02-24 14:15:28 +0000 |
| commit | 1b3a5d652c92cf5b091964110f4ba1251acbf9f4 (patch) | |
| tree | 31bde11f895d8750a67b6a43c5fe4aa6578ac308 /cpp/src/qpid/broker/ConnectionHandler.cpp | |
| parent | 29f3702dedf1753f350a412a6c026df72caa8534 (diff) | |
| download | qpid-python-1b3a5d652c92cf5b091964110f4ba1251acbf9f4.tar.gz | |
QPID-1676 - Added client process name and pid to connection object for management.
Supported in C++, Python, and Ruby clients.
Still needs to be added to the Java clients.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@747389 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/broker/ConnectionHandler.cpp')
| -rw-r--r-- | cpp/src/qpid/broker/ConnectionHandler.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/cpp/src/qpid/broker/ConnectionHandler.cpp b/cpp/src/qpid/broker/ConnectionHandler.cpp index f136d61462..b79342b86c 100644 --- a/cpp/src/qpid/broker/ConnectionHandler.cpp +++ b/cpp/src/qpid/broker/ConnectionHandler.cpp @@ -46,6 +46,9 @@ const std::string en_US = "en_US"; const std::string QPID_FED_LINK = "qpid.fed_link"; const std::string QPID_FED_TAG = "qpid.federation_tag"; const std::string SESSION_FLOW_CONTROL("qpid.session_flow"); +const std::string CLIENT_PROCESS_NAME("qpid.client_process"); +const std::string CLIENT_PID("qpid.client_pid"); +const std::string CLIENT_PPID("qpid.client_ppid"); const int SESSION_FLOW_CONTROL_VER = 1; } @@ -141,9 +144,22 @@ void ConnectionHandler::Handler::startOk(const framing::FieldTable& clientProper } QPID_LOG(info, "Connection is a federation link"); } - if ( clientProperties.getAsInt(SESSION_FLOW_CONTROL) == SESSION_FLOW_CONTROL_VER ) { + if (clientProperties.getAsInt(SESSION_FLOW_CONTROL) == SESSION_FLOW_CONTROL_VER) { connection.setClientThrottling(); } + + if (connection.getMgmtObject() != 0) { + string procName = clientProperties.getAsString(CLIENT_PROCESS_NAME); + uint32_t pid = clientProperties.getAsInt(CLIENT_PID); + uint32_t ppid = clientProperties.getAsInt(CLIENT_PPID); + + if (!procName.empty()) + connection.getMgmtObject()->set_remoteProcessName(procName); + if (pid != 0) + connection.getMgmtObject()->set_remotePid(pid); + if (ppid != 0) + connection.getMgmtObject()->set_remoteParentPid(ppid); + } } void ConnectionHandler::Handler::secureOk(const string& response) |
