diff options
author | Andrew Stitcher <astitcher@apache.org> | 2010-12-23 17:11:17 +0000 |
---|---|---|
committer | Andrew Stitcher <astitcher@apache.org> | 2010-12-23 17:11:17 +0000 |
commit | 9edbbed1adb5b5731ef875f465a346494e639792 (patch) | |
tree | 32c362c6c67230f96818ba16d5c795f8a5787bfb /cpp/src | |
parent | 632183f9ca6cf81a5720d0205fa4d410a7350a8c (diff) | |
download | qpid-python-9edbbed1adb5b5731ef875f465a346494e639792.tar.gz |
Allow for the case where we get an rdma reject because there is no one listening
on the resolved address
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1052326 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rw-r--r-- | cpp/src/qpid/sys/rdma/RdmaIO.cpp | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/cpp/src/qpid/sys/rdma/RdmaIO.cpp b/cpp/src/qpid/sys/rdma/RdmaIO.cpp index e082fdc416..b5cedf3d70 100644 --- a/cpp/src/qpid/sys/rdma/RdmaIO.cpp +++ b/cpp/src/qpid/sys/rdma/RdmaIO.cpp @@ -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; } |