[Pvfs2-cvs] commit by pcarns in pvfs2/src/io/bmi/bmi_tcp: bmi-tcp.c

CVS commit program cvs at parl.clemson.edu
Sun Jun 7 15:36:04 EDT 2009


Update of /projects/cvsroot/pvfs2/src/io/bmi/bmi_tcp
In directory parlweb1:/tmp/cvs-serv3754

Modified Files:
      Tag: tcp-peer-comm-branch
	bmi-tcp.c 
Log Message:
proper cleanup for secondary socket connections


Index: bmi-tcp.c
===================================================================
RCS file: /projects/cvsroot/pvfs2/src/io/bmi/bmi_tcp/bmi-tcp.c,v
diff -p -u -r1.142.16.4 -r1.142.16.5
--- bmi-tcp.c	7 Jun 2009 19:30:32 -0000	1.142.16.4
+++ bmi-tcp.c	7 Jun 2009 19:36:04 -0000	1.142.16.5
@@ -1983,8 +1983,6 @@ void tcp_forget_addr(bmi_method_addr_p m
     bmi_method_addr_p tmp_addr;
     int tmp_status;
 
-    gossip_err("TODO: need to handle primary/secondary case!\n");
-
     if (tcp_socket_collection_p)
     {
 	BMI_socket_collection_remove(tcp_socket_collection_p, map);
@@ -2006,15 +2004,26 @@ void tcp_forget_addr(bmi_method_addr_p m
         map->ref_count--;
         if(map->ref_count == 0)
         {
+            if(map->secondary)
+            {
+                dealloc_tcp_method_addr(map->secondary);
+            }
+            if(map->primary)
+            {
+                map->primary->secondary = NULL;
+            }
 	    dealloc_tcp_method_addr(map);
         }
     }
     else
     {
-        /* this will cause the bmi control layer to check to see if 
-         * this address can be completely forgotten
-         */
-        bmi_method_addr_forget_callback(bmi_addr);
+        if(!map->primary)
+        {
+            /* this will cause the bmi control layer to check to see if 
+             * this address can be completely forgotten
+             */
+            bmi_method_addr_forget_callback(bmi_addr);
+        }
     }
     return;
 };



More information about the Pvfs2-cvs mailing list