diff options
Diffstat (limited to 'qpid/cpp')
-rw-r--r-- | qpid/cpp/src/qpid/broker/PersistableQueue.h | 7 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/broker/amqp/Connection.cpp | 10 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/broker/amqp/Session.cpp | 4 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/management/ManagementAgent.cpp | 4 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/messaging/amqp/AddressHelper.cpp | 7 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp | 4 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/messaging/amqp/ReceiverContext.h | 2 | ||||
-rw-r--r-- | qpid/cpp/src/qpid/messaging/amqp/SenderContext.h | 2 | ||||
-rw-r--r-- | qpid/cpp/src/tests/Variant.cpp | 10 | ||||
-rw-r--r-- | qpid/cpp/src/tests/brokertest.py | 19 |
10 files changed, 35 insertions, 34 deletions
diff --git a/qpid/cpp/src/qpid/broker/PersistableQueue.h b/qpid/cpp/src/qpid/broker/PersistableQueue.h index 655d26bc74..6733163084 100644 --- a/qpid/cpp/src/qpid/broker/PersistableQueue.h +++ b/qpid/cpp/src/qpid/broker/PersistableQueue.h @@ -25,7 +25,6 @@ #include <string> #include "qpid/broker/Persistable.h" #include "qpid/management/Manageable.h" -#include <boost/shared_ptr.hpp> namespace qpid { namespace broker { @@ -51,12 +50,12 @@ public: class PersistableQueue : public Persistable { public: - typedef boost::shared_ptr<PersistableQueue> shared_ptr; - virtual const std::string& getName() const = 0; virtual ~PersistableQueue() { - if (externalQueueStore) + if (externalQueueStore) { delete externalQueueStore; + externalQueueStore = 0; + } }; virtual void setExternalQueueStore(ExternalQueueStore* inst) = 0; diff --git a/qpid/cpp/src/qpid/broker/amqp/Connection.cpp b/qpid/cpp/src/qpid/broker/amqp/Connection.cpp index e315e55843..5593f755e5 100644 --- a/qpid/cpp/src/qpid/broker/amqp/Connection.cpp +++ b/qpid/cpp/src/qpid/broker/amqp/Connection.cpp @@ -453,16 +453,6 @@ void Connection::process() } #endif // !HAVE_PROTON_EVENTS } -namespace { -std::string convert(pn_delivery_tag_t in) -{ -#ifdef NO_PROTON_DELIVERY_TAG_T - return std::string(in.start, in.size); -#else - return std::string(in.bytes, in.size); -#endif -} -} void Connection::processDeliveries() { #ifdef HAVE_PROTON_EVENTS diff --git a/qpid/cpp/src/qpid/broker/amqp/Session.cpp b/qpid/cpp/src/qpid/broker/amqp/Session.cpp index 3b65e6a64d..9cd6aae26f 100644 --- a/qpid/cpp/src/qpid/broker/amqp/Session.cpp +++ b/qpid/cpp/src/qpid/broker/amqp/Session.cpp @@ -835,7 +835,7 @@ void Session::abort() tx.dischargeComplete(); tx.buffer->rollback(); txAborted(); - tx.buffer.reset(); + tx.buffer = boost::intrusive_ptr<TxBuffer>(); QPID_LOG(debug, "Transaction " << tx.id << " rolled back"); } } @@ -848,7 +848,7 @@ void Session::committed(bool sync) if (tx.buffer.get()) { tx.buffer->endCommit(&connection.getBroker().getStore()); txCommitted(); - tx.buffer.reset(); + tx.buffer = boost::intrusive_ptr<TxBuffer>(); QPID_LOG(debug, "Transaction " << tx.id << " comitted"); } else { throw Exception(qpid::amqp::error_conditions::transaction::ROLLBACK, "tranaction vanished during async commit"); diff --git a/qpid/cpp/src/qpid/management/ManagementAgent.cpp b/qpid/cpp/src/qpid/management/ManagementAgent.cpp index 1eab6f622b..516babce61 100644 --- a/qpid/cpp/src/qpid/management/ManagementAgent.cpp +++ b/qpid/cpp/src/qpid/management/ManagementAgent.cpp @@ -706,8 +706,8 @@ void ManagementAgent::moveNewObjects() void ManagementAgent::periodicProcessing (void) { #define HEADROOM 4096 - debugSnapshot("Management agent periodic processing"); sys::Mutex::ScopedLock lock (userLock); + debugSnapshot("Management agent periodic processing"); string routingKey; string sBuf; @@ -2704,6 +2704,8 @@ string ManagementAgent::summarizeAgents() { void ManagementAgent::debugSnapshot(const char* title) { + sys::Mutex::ScopedLock lock(addLock); + sys::Mutex::ScopedLock objLock (objectLock); QPID_LOG(debug, title << ": management snapshot: " << packages.size() << " packages, " << summarizeMap("objects", managementObjects) diff --git a/qpid/cpp/src/qpid/messaging/amqp/AddressHelper.cpp b/qpid/cpp/src/qpid/messaging/amqp/AddressHelper.cpp index 2106e21686..8033cc5dee 100644 --- a/qpid/cpp/src/qpid/messaging/amqp/AddressHelper.cpp +++ b/qpid/cpp/src/qpid/messaging/amqp/AddressHelper.cpp @@ -138,13 +138,6 @@ uint64_t getFilterDescriptor(const std::string& key) { return hasWildcards(key) ? qpid::amqp::filters::LEGACY_TOPIC_FILTER_CODE : qpid::amqp::filters::LEGACY_DIRECT_FILTER_CODE; } -bool contains(const Variant::List& list, const std::string& item) -{ - for (Variant::List::const_iterator i = list.begin(); i != list.end(); ++i) { - if (*i == item) return true; - } - return false; -} bool test(const Variant::Map& options, const std::string& name) { diff --git a/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp b/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp index d4a7b60e3c..0c516311da 100644 --- a/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp +++ b/qpid/cpp/src/qpid/messaging/amqp/ConnectionContext.cpp @@ -230,7 +230,7 @@ void ConnectionContext::close() } if (ticker) { ticker->cancel(); - ticker.reset(); + ticker = boost::intrusive_ptr<qpid::sys::TimerTask>(); } } @@ -1236,7 +1236,7 @@ void ConnectionContext::startTxSession(boost::shared_ptr<SessionContext> session QPID_LOG(debug, id << " attaching transaction for " << session->getName()); boost::shared_ptr<Transaction> tx(new Transaction(session->session)); session->transaction = tx; - attach(session, tx); + attach(session, boost::shared_ptr<SenderContext>(tx)); tx->declare(boost::bind(&ConnectionContext::send, this, _1, _2, _3, _4, _5), session); } catch (const Exception& e) { throw TransactionError(Msg() << "Cannot start transaction: " << e.what()); diff --git a/qpid/cpp/src/qpid/messaging/amqp/ReceiverContext.h b/qpid/cpp/src/qpid/messaging/amqp/ReceiverContext.h index 2b4e8e1986..dd1352aecb 100644 --- a/qpid/cpp/src/qpid/messaging/amqp/ReceiverContext.h +++ b/qpid/cpp/src/qpid/messaging/amqp/ReceiverContext.h @@ -46,7 +46,7 @@ class ReceiverContext { public: ReceiverContext(pn_session_t* session, const std::string& name, const qpid::messaging::Address& source); - ~ReceiverContext(); + virtual ~ReceiverContext(); void reset(pn_session_t* session); void setCapacity(uint32_t); uint32_t getCapacity(); diff --git a/qpid/cpp/src/qpid/messaging/amqp/SenderContext.h b/qpid/cpp/src/qpid/messaging/amqp/SenderContext.h index 4d3c4bee79..467a8e0d3d 100644 --- a/qpid/cpp/src/qpid/messaging/amqp/SenderContext.h +++ b/qpid/cpp/src/qpid/messaging/amqp/SenderContext.h @@ -76,7 +76,7 @@ class SenderContext const qpid::messaging::Address& target, bool setToOnSend, const CoordinatorPtr& transaction = CoordinatorPtr()); - ~SenderContext(); + virtual ~SenderContext(); virtual void reset(pn_session_t* session); virtual void close(); diff --git a/qpid/cpp/src/tests/Variant.cpp b/qpid/cpp/src/tests/Variant.cpp index d6605f9fe5..5ae7fc89eb 100644 --- a/qpid/cpp/src/tests/Variant.cpp +++ b/qpid/cpp/src/tests/Variant.cpp @@ -815,12 +815,16 @@ QPID_AUTO_TEST_CASE(described) BOOST_CHECK(!a.isDescribed()); a.getDescriptors().push_back("foo"); BOOST_CHECK(a.isDescribed()); - BOOST_CHECK_EQUAL(a.getDescriptors(), list_of<Variant>("foo")); + BOOST_CHECK_EQUAL(a.getDescriptors().size(), 1U); + BOOST_CHECK_EQUAL(a.getDescriptors().front(), Variant("foo")); a = 42; BOOST_CHECK(a.isDescribed()); - BOOST_CHECK_EQUAL(a.getDescriptors(), list_of<Variant>("foo")); + BOOST_CHECK_EQUAL(a.getDescriptors().size(), 1U); + BOOST_CHECK_EQUAL(a.getDescriptors().front(), Variant("foo")); a.getDescriptors().push_back(33); - BOOST_CHECK_EQUAL(a.getDescriptors(), list_of<Variant>("foo")(33)); + BOOST_CHECK_EQUAL(a.getDescriptors().size(), 2U); + BOOST_CHECK_EQUAL(a.getDescriptors().front(), Variant("foo")); + BOOST_CHECK_EQUAL(*(++a.getDescriptors().begin()), Variant(33)); a.getDescriptors().clear(); BOOST_CHECK(!a.isDescribed()); } diff --git a/qpid/cpp/src/tests/brokertest.py b/qpid/cpp/src/tests/brokertest.py index 2566bc527d..6fae88092b 100644 --- a/qpid/cpp/src/tests/brokertest.py +++ b/qpid/cpp/src/tests/brokertest.py @@ -21,7 +21,6 @@ import os, signal, string, tempfile, subprocess, socket, threading, time, imp, re import qpid, traceback, signal -import proton from qpid import connection, util from qpid.compat import format_exc from unittest import TestCase @@ -493,7 +492,16 @@ class BrokerTest(TestCase): test_store_lib = os.getenv("TEST_STORE_LIB") rootdir = os.getcwd() - PN_VERSION = (proton.VERSION_MAJOR, proton.VERSION_MINOR) + try: + import proton + PN_VERSION = (proton.VERSION_MAJOR, proton.VERSION_MINOR) + except ImportError: + # proton not on path, can't determine version + PN_VERSION = (0, 0) + except AttributeError: + # prior to 0.8 proton did not expose version info + PN_VERSION = (0, 7) + PN_TX_VERSION = (0, 9) amqp_tx_supported = PN_VERSION >= PN_TX_VERSION @@ -501,7 +509,12 @@ class BrokerTest(TestCase): @classmethod def amqp_tx_warning(cls): if not cls.amqp_tx_supported: - print "WARNING: Cannot test transactions over AMQP 1.0, proton version %s.%s < %s.%s" % (cls.PN_VERSION + cls.PN_TX_VERSION) + if cls.PN_VERSION == (0, 0): + print "WARNING: Cannot test transactions over AMQP 1.0, proton not on path so version could not be determined" + elif cls.PN_VERSION == (0, 7): + print "WARNING: Cannot test transactions over AMQP 1.0, proton version is 0.7 or less, %s.%s required" % cls.PN_TX_VERSION + else: + print "WARNING: Cannot test transactions over AMQP 1.0, proton version %s.%s < %s.%s" % (cls.PN_VERSION + cls.PN_TX_VERSION) return False return True |