You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2010/12/23 18:11:17 UTC

svn commit: r1052326 - /qpid/trunk/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp

Author: astitcher
Date: Thu Dec 23 17:11:17 2010
New Revision: 1052326

URL: http://svn.apache.org/viewvc?rev=1052326&view=rev
Log:
Allow for the case where we get an rdma reject because there is no one listening
on the resolved address

Modified:
    qpid/trunk/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp?rev=1052326&r1=1052325&r2=1052326&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/rdma/RdmaIO.cpp Thu Dec 23 17:11:17 2010
@@ -634,10 +634,20 @@ namespace Rdma {
             break;
         case RDMA_CM_EVENT_REJECTED: {
             // CONNECTING
-            // Extract private data from event
-            assert(conn_param.private_data && conn_param.private_data_len >= sizeof(NConnectionParams));
-            const NConnectionParams* rcp = static_cast<const NConnectionParams*>(conn_param.private_data);
-            ConnectionParams cp = *rcp;
+            
+            // We can get this event if our peer is not running on the other side
+            // in this case we could get nearly anything in the private data:
+            // From private_data == 0 && private_data_len == 0 (Chelsio iWarp)
+            // to 148 bytes of zeros (Mellanox IB)
+            // 
+            // So assume that if the the private data is absent or not the size of 
+            // the connection parameters it isn't valid
+            ConnectionParams cp(0, 0, 0);
+            if (conn_param.private_data && conn_param.private_data_len == sizeof(NConnectionParams)) {
+                // Extract private data from event
+                const NConnectionParams* rcp = static_cast<const NConnectionParams*>(conn_param.private_data);
+                cp = *rcp;
+            }
             rejectedCallback(ci, cp);
             break;
         }



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