Преглед изворни кода

defect 828
assert in totemsrp_avail occurs with certain test cases. The code was rounding
down to zero when calculating the number of messages required. This patch adds
one in all cases so no roundoff occurs.


git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@807 fd59a12c-fef9-0310-b244-a6a79926bd2f

Steven Dake пре 20 година
родитељ
комит
21199e23cc
1 измењених фајлова са 8 додато и 1 уклоњено
  1. 8 1
      exec/totempg.c

+ 8 - 1
exec/totempg.c

@@ -641,8 +641,15 @@ int totempg_send_ok (
 	int total;
 
 	avail = totemmrp_avail ();
+	
+	/*
+	 * msg size less then totempg_totem_config->net_mtu - 25 will take up
+	 * a full message, so add +1
+	 * totempg_totem_config->net_mtu - 25 is for the totempg_mcast header
+	 */
+
 
-	total = (msg_size / (totempg_totem_config->net_mtu - 25) /* for totempg_mcat header */);
+	total = (msg_size / (totempg_totem_config->net_mtu - 25)) + 1; 
 
 	return (avail >= total);
 }