diff options
| author | Alan Conway <aconway@apache.org> | 2008-09-26 17:11:19 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2008-09-26 17:11:19 +0000 |
| commit | b22dd47558cc11572d080ac25808012092dda597 (patch) | |
| tree | 32c1948cfa796d74bbb8e5d137c1413900311b22 /cpp/src/qpid/cluster | |
| parent | 13214589d918524d7058b673098fea03179290bd (diff) | |
| download | qpid-python-b22dd47558cc11572d080ac25808012092dda597.tar.gz | |
Fix build problems on rhel 5.2 and 64-bit encoding bug.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@699413 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster')
| -rw-r--r-- | cpp/src/qpid/cluster/Cluster.cpp | 2 | ||||
| -rw-r--r-- | cpp/src/qpid/cluster/Cluster.h | 10 | ||||
| -rw-r--r-- | cpp/src/qpid/cluster/DumpClient.cpp | 7 | ||||
| -rw-r--r-- | cpp/src/qpid/cluster/Event.cpp | 6 | ||||
| -rw-r--r-- | cpp/src/qpid/cluster/Event.h | 4 |
5 files changed, 17 insertions, 12 deletions
diff --git a/cpp/src/qpid/cluster/Cluster.cpp b/cpp/src/qpid/cluster/Cluster.cpp index 7edf9f9392..c1775616a8 100644 --- a/cpp/src/qpid/cluster/Cluster.cpp +++ b/cpp/src/qpid/cluster/Cluster.cpp @@ -115,7 +115,7 @@ void Cluster::mcastControl(const framing::AMQBody& body, Connection* cptr) { mcastEvent(e); } -void Cluster::mcastBuffer(const char* data, size_t size, const ConnectionId& connection, size_t id) { +void Cluster::mcastBuffer(const char* data, size_t size, const ConnectionId& connection, uint32_t id) { Event e(DATA, connection, size, id); memcpy(e.getData(), data, size); QPID_LOG(trace, "MCAST " << e); diff --git a/cpp/src/qpid/cluster/Cluster.h b/cpp/src/qpid/cluster/Cluster.h index ec43c56c69..eaa91202dc 100644 --- a/cpp/src/qpid/cluster/Cluster.h +++ b/cpp/src/qpid/cluster/Cluster.h @@ -77,7 +77,7 @@ class Cluster : private Cpg::Handler, public management::Manageable /** Send to the cluster */ void mcastControl(const framing::AMQBody& controlBody, Connection* cptr); - void mcastBuffer(const char*, size_t, const ConnectionId&, size_t id); + void mcastBuffer(const char*, size_t, const ConnectionId&, uint32_t id); void mcastEvent(const Event& e); /** Leave the cluster */ @@ -97,8 +97,8 @@ class Cluster : private Cpg::Handler, public management::Manageable void setDumpComplete(); template <class F> void eachConnection(const F& f) { - std::for_each(connections.begin(), connections.end(), - boost::bind(f, boost::bind(&ConnectionMap::value_type::second, _1))); + for (ConnectionMap::const_iterator i = connections.begin(); i != connections.end(); ++i) + f(i->second); } private: @@ -143,7 +143,7 @@ class Cluster : private Cpg::Handler, public management::Manageable virtual management::Manageable::status_t ManagementMethod (uint32_t methodId, management::Args& args, std::string& text); void stopClusterNode(void); void stopFullCluster(void); - void updateMemberStats(void); + void updateMemberStats(void); mutable sys::Monitor lock; // Protect access to members. broker::Broker& broker; @@ -165,7 +165,7 @@ class Cluster : private Cpg::Handler, public management::Manageable JoiningHandler joiningHandler; MemberHandler memberHandler; - size_t mcastId; + uint32_t mcastId; friend class ClusterHandler; friend class JoiningHandler; diff --git a/cpp/src/qpid/cluster/DumpClient.cpp b/cpp/src/qpid/cluster/DumpClient.cpp index ee87afb468..d2d3c9bb15 100644 --- a/cpp/src/qpid/cluster/DumpClient.cpp +++ b/cpp/src/qpid/cluster/DumpClient.cpp @@ -168,6 +168,10 @@ void DumpClient::dumpConnection(const boost::intrusive_ptr<Connection>& dumpConn QPID_LOG(debug, donor.getId() << " dumped connection " << *dumpConnection); } +// FIXME aconway 2008-09-26: REMOVE +void foo(broker::SemanticState::ConsumerImpl*) {} + + void DumpClient::dumpSession(broker::SessionHandler& sh) { QPID_LOG(debug, donor.getId() << " dumping session " << &sh.getConnection() << "[" << sh.getChannel() << "] = " << sh.getSession()->getId()); @@ -187,7 +191,8 @@ void DumpClient::dumpSession(broker::SessionHandler& sh) { // Re-create session state on remote connection. broker::SessionState* ss = sh.getSession(); - ss->eachConsumer(boost::bind(&DumpClient::dumpConsumer, this, _1)); + // For reasons unknown, boost::bind does not work here with boost 1.33. + ss->eachConsumer(std::bind1st(std::mem_fun(&DumpClient::dumpConsumer),this)); // FIXME aconway 2008-09-19: remaining session state. diff --git a/cpp/src/qpid/cluster/Event.cpp b/cpp/src/qpid/cluster/Event.cpp index 43335e3607..2531001504 100644 --- a/cpp/src/qpid/cluster/Event.cpp +++ b/cpp/src/qpid/cluster/Event.cpp @@ -31,16 +31,16 @@ namespace cluster { using framing::Buffer; -const size_t Event::OVERHEAD = sizeof(uint8_t) + sizeof(uint64_t) + sizeof(size_t); +const size_t Event::OVERHEAD = sizeof(uint8_t) + sizeof(uint64_t) + sizeof(uint32_t); -Event::Event(EventType t, const ConnectionId& c, size_t s, size_t i) +Event::Event(EventType t, const ConnectionId& c, size_t s, uint32_t i) : type(t), connectionId(c), size(s), data(RefCountedBuffer::create(s)), id(i) {} Event Event::delivered(const MemberId& m, void* d, size_t s) { Buffer buf(static_cast<char*>(d), s); EventType type((EventType)buf.getOctet()); ConnectionId connection(m, reinterpret_cast<Connection*>(buf.getLongLong())); - size_t id = buf.getLong(); + uint32_t id = buf.getLong(); assert(buf.getPosition() == OVERHEAD); Event e(type, connection, s-OVERHEAD, id); memcpy(e.getData(), static_cast<char*>(d)+OVERHEAD, s-OVERHEAD); diff --git a/cpp/src/qpid/cluster/Event.h b/cpp/src/qpid/cluster/Event.h index 12a7a9388a..6d8655392e 100644 --- a/cpp/src/qpid/cluster/Event.h +++ b/cpp/src/qpid/cluster/Event.h @@ -43,7 +43,7 @@ namespace cluster { class Event { public: /** Create an event to mcast with a buffer of size bytes. */ - Event(EventType t=DATA, const ConnectionId& c=ConnectionId(), size_t size=0, size_t id=0); + Event(EventType t=DATA, const ConnectionId& c=ConnectionId(), size_t size=0, uint32_t id=0); /** Create an event copied from delivered data. */ static Event delivered(const MemberId& m, void* data, size_t size); @@ -65,7 +65,7 @@ class Event { ConnectionId connectionId; size_t size; RefCountedBuffer::pointer data; - size_t id; + uint32_t id; }; std::ostream& operator << (std::ostream&, const Event&); |
