[WSD] Remove sockets from tracking map when RTU or duplication fails.
authorftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 27 Sep 2005 00:29:35 +0000 (00:29 +0000)
committerftillier <ftillier@ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86>
Tue, 27 Sep 2005 00:29:35 +0000 (00:29 +0000)
Signed-off-by: Fab Tillier (ftillier@silverstorm.com)
git-svn-id: svn://openib.tc.cornell.edu/gen1/trunk@90 ad392aa1-c5ef-ae45-8dd8-e69d62a5ef86

ulp/wsd/user/ib_cm.c
ulp/wsd/user/ibspdll.c

index 44d639b..b745983 100644 (file)
@@ -247,8 +247,12 @@ cm_rep_callback(
                if( status != IB_SUCCESS )\r
                {\r
                        /* Note: a REJ has been automatically sent. */\r
-                       IBSP_ERROR( ("ib_cm_rtu failed (0x%d)\n", status) );\r
+                       IBSP_ERROR( ("ib_cm_rtu returned %s\n", ib_get_err_str( status )) );\r
                        IBSP_CHANGE_SOCKET_STATE( socket_info, IBSP_BIND );\r
+\r
+                       /* We changed the state - remove from connection map. */\r
+                       ibsp_conn_remove( socket_info );\r
+\r
                        ibsp_post_select_event( socket_info, FD_CONNECT, WSAETIMEDOUT );\r
                }\r
                else\r
@@ -262,14 +266,20 @@ cm_rep_callback(
                status = ib_cm_rtu( p_cm_rep_rec->h_cm_rep, &cm_rtu );\r
                if( status != IB_SUCCESS )\r
                {\r
+                       IBSP_CHANGE_SOCKET_STATE( socket_info, IBSP_BIND );\r
+\r
+                       /* We changed the state - remove from connection map. */\r
+                       ibsp_conn_remove( socket_info );\r
+\r
                        /* Note: a REJ has been automatically sent. */\r
-                       IBSP_ERROR( ("ib_cm_rtu failed (0x%d)\n", status) );\r
+                       IBSP_ERROR( ("ib_cm_rtu returned %s\n", ib_get_err_str( status )) );\r
                }\r
                else\r
                {\r
                        IBSP_CHANGE_SOCKET_STATE( socket_info, IBSP_CONNECTED );\r
                }\r
                SetEvent( socket_info->h_event );\r
+               break;\r
 \r
        default:\r
                /* The socket might be closing */\r
@@ -414,7 +424,7 @@ cm_rej_callback(
 \r
        IBSP_ENTER( IBSP_DBG_CM );\r
 \r
-       IBSP_TRACE( IBSP_DBG_CONN, ("socket %p connect reject, reason=%d\n",\r
+       IBSP_TRACE( IBSP_DBG_CM, ("socket %p connect reject, reason=%d\n",\r
                socket_info, cl_ntoh16(p_cm_rej_rec->rej_status)) );\r
 \r
        cl_spinlock_acquire( &socket_info->mutex );\r
@@ -519,7 +529,11 @@ cm_dreq_callback(
 \r
                                ret = ib_listen( socket_info );\r
                                if( !ret )\r
+                               {\r
+                                       /* We changed the state - remove from connection map. */\r
+                                       ibsp_conn_remove( socket_info );\r
                                        break;\r
+                               }\r
 \r
                                IBSP_ERROR_EXIT( ("ib_listen failed with %d\n", ret) );\r
                                /* Fall through. */\r
index eb47fb4..6209647 100644 (file)
@@ -1493,7 +1493,7 @@ IBSPListen(
                if( ret )\r
                {\r
                        IBSP_CHANGE_SOCKET_STATE( socket_info, IBSP_BIND );\r
-                       CL_EXIT_ERROR( IBSP_DBG_CONN, gdbg_lvl, ("ib_listen failed with %d\n", ret) );\r
+                       IBSP_ERROR_EXIT( ("ib_listen failed with %d\n", ret) );\r
                }\r
                break;\r
 \r