You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by tr...@apache.org on 2011/03/07 22:45:03 UTC

svn commit: r1078967 - in /qpid/branches/0.10/qpid: cpp/src/qmf/ConsoleSession.cpp extras/qmf/src/py/qmf/console.py

Author: tross
Date: Mon Mar  7 21:45:03 2011
New Revision: 1078967

URL: http://svn.apache.org/viewvc?rev=1078967&view=rev
Log:
QPID-3122 - Merged fix from trunk.

Modified:
    qpid/branches/0.10/qpid/cpp/src/qmf/ConsoleSession.cpp
    qpid/branches/0.10/qpid/extras/qmf/src/py/qmf/console.py

Modified: qpid/branches/0.10/qpid/cpp/src/qmf/ConsoleSession.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/0.10/qpid/cpp/src/qmf/ConsoleSession.cpp?rev=1078967&r1=1078966&r2=1078967&view=diff
==============================================================================
--- qpid/branches/0.10/qpid/cpp/src/qmf/ConsoleSession.cpp (original)
+++ qpid/branches/0.10/qpid/cpp/src/qmf/ConsoleSession.cpp Mon Mar  7 21:45:03 2011
@@ -429,7 +429,23 @@ void ConsoleSessionImpl::handleAgentUpda
     iter = content.find("_values");
     if (iter == content.end())
         return;
-    Variant::Map attrs(iter->second.asMap());
+    const Variant::Map& in_attrs(iter->second.asMap());
+    Variant::Map attrs;
+
+    //
+    // Copy the map from the message to "attrs".  Translate any old-style
+    // keys to their new key values in the process.
+    //
+    for (iter = in_attrs.begin(); iter != in_attrs.end(); iter++) {
+        if      (iter->first == "epoch")
+            attrs[protocol::AGENT_ATTR_EPOCH] = iter->second;
+        else if (iter->first == "timestamp")
+            attrs[protocol::AGENT_ATTR_TIMESTAMP] = iter->second;
+        else if (iter->first == "heartbeat_interval")
+            attrs[protocol::AGENT_ATTR_HEARTBEAT_INTERVAL] = iter->second;
+        else
+            attrs[iter->first] = iter->second;
+    }
 
     iter = attrs.find(protocol::AGENT_ATTR_EPOCH);
     if (iter != attrs.end())

Modified: qpid/branches/0.10/qpid/extras/qmf/src/py/qmf/console.py
URL: http://svn.apache.org/viewvc/qpid/branches/0.10/qpid/extras/qmf/src/py/qmf/console.py?rev=1078967&r1=1078966&r2=1078967&view=diff
==============================================================================
--- qpid/branches/0.10/qpid/extras/qmf/src/py/qmf/console.py (original)
+++ qpid/branches/0.10/qpid/extras/qmf/src/py/qmf/console.py Mon Mar  7 21:45:03 2011
@@ -1211,11 +1211,22 @@ class Session:
     try:
       agentName = ah["qmf.agent"]
       values = content["_values"]
-      timestamp = values["_timestamp"]
-      interval = values["_heartbeat_interval"]
+
+      if '_timestamp' in values:
+        timestamp = values["_timestamp"]
+      else:
+        timestamp = values['timestamp']
+
+      if '_heartbeat_interval' in values:
+        interval = values['_heartbeat_interval']
+      else:
+        interval = values['heartbeat_interval']
+
       epoch = 0
       if '_epoch' in values:
         epoch = values['_epoch']
+      elif 'epoch' in values:
+        epoch = values['epoch']
     except Exception,e:
       return
 
@@ -2416,7 +2427,7 @@ class Broker(Thread):
       if uid.__class__ == tuple and len(uid) == 2:
         self.saslUser = uid[1]
       else:
-        self.saslUser = None
+        self.saslUser = self.authUser
 
       # prevent topic queues from filling up (and causing the agents to
       # disconnect) by discarding the oldest queued messages when full.



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org