qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r590688 - in /incubator/qpid/trunk/qpid/cpp/src/qpid: broker/Queue.cpp broker/SessionHandler.cpp client/Message.h client/SessionCore.cpp sys/Dispatcher.cpp
Date Wed, 31 Oct 2007 14:50:59 GMT
Author: aconway
Date: Wed Oct 31 07:50:58 2007
New Revision: 590688

URL: http://svn.apache.org/viewvc?rev=590688&view=rev
Log:

Fix client side core dump when disconneced unexpectedly:
 void qpid::client::SessionCore::invariant() const: Assertion

Minor items:
src/qpid/broker/Queue.cpp: info log for each message dispatched.  
src/qpid/broker/SessionHandler.cpp: check attached in handleOut()
src/qpid/sys/Dispatcher.cpp: use polymorphic_downcast to catch cast errors in debug builds.
src/qpid/client/SessionCore.cpp: fix incorrect asserts
src/qpid/client/Message.h: convenience constructor parameters

Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionHandler.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/client/Message.h
    incubator/qpid/trunk/qpid/cpp/src/qpid/client/SessionCore.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/sys/Dispatcher.cpp

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp?rev=590688&r1=590687&r2=590688&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/Queue.cpp Wed Oct 31 07:50:58 2007
@@ -182,6 +182,7 @@
 
 bool Queue::dispatch(QueuedMessage& msg)
 {
+    QPID_LOG(info, "Dispatch message " << msg.position << " from queue " <<
name);
     //additions to the acquirers will result in a separate dispatch
     //request, so won't result in anyone being missed
     uint counter = getAcquirerCount();

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionHandler.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionHandler.cpp?rev=590688&r1=590687&r2=590688&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionHandler.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/broker/SessionHandler.cpp Wed Oct 31 07:50:58 2007
@@ -80,6 +80,9 @@
 }
 
 void SessionHandler::handleOut(AMQFrame& f) {
+    if (!session.get())
+        throw InternalErrorException(
+            QPID_MSG("attempt to send frame on detached channel."));
     channel.handle(f);          // Send it.
     if (session->sent(f))
         peerSession.solicitAck();

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/client/Message.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/client/Message.h?rev=590688&r1=590687&r2=590688&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/client/Message.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/client/Message.h Wed Oct 31 07:50:58 2007
@@ -38,7 +38,10 @@
 class Message : public framing::TransferContent 
 {
 public:
-    Message(const std::string& data_=std::string()) : TransferContent(data_) {}
+    Message(const std::string& data_=std::string(),
+            const std::string& routingKey=std::string(),
+            const std::string& exchange=std::string()
+    ) : TransferContent(data_, routingKey, exchange) {}
 
     std::string getDestination() const 
     { 

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/client/SessionCore.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/client/SessionCore.cpp?rev=590688&r1=590687&r2=590688&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/client/SessionCore.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/client/SessionCore.cpp Wed Oct 31 07:50:58 2007
@@ -62,13 +62,11 @@
       case CLOSING:
       case SUSPENDING:
         assert(session);
-        assert(code==REPLY_SUCCESS);
         assert(connection);
         assert(channel.get());
         assert(channel.next == connection.get());
         break;
       case SUSPENDED:
-        assert(code==REPLY_SUCCESS);
         assert(session);
         assert(!connection);
         break;

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/sys/Dispatcher.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/sys/Dispatcher.cpp?rev=590688&r1=590687&r2=590688&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/sys/Dispatcher.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/sys/Dispatcher.cpp Wed Oct 31 07:50:58 2007
@@ -21,6 +21,8 @@
 
 #include "Dispatcher.h"
 
+#include <boost/cast.hpp>
+
 #include <assert.h>
 
 namespace qpid {
@@ -36,7 +38,8 @@
 void Dispatcher::run() {
     do {
         Poller::Event event = poller->wait();
-        DispatchHandle* h = static_cast<DispatchHandle*>(event.handle);
+        DispatchHandle* h =
+            boost::polymorphic_downcast<DispatchHandle*>(event.handle);
 
         // If can read/write then dispatch appropriate callbacks        
         if (h) {



Mime
View raw message