changeset 371:97aa54c9afe6

*** empty log message ***
author kono
date Tue, 21 Oct 2008 22:50:57 +0900
parents 46c95d8885ad
children e16b6326fdac
files rep/SessionManager.java
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/rep/SessionManager.java	Tue Oct 21 22:40:30 2008 +0900
+++ b/rep/SessionManager.java	Tue Oct 21 22:50:57 2008 +0900
@@ -617,15 +617,19 @@
 			routingTable.add(forwarder,getSMID(command.eid));
 			REPCommand ack = new REPCommand(command); ack.setCMD(REP.SMCMD_PUT_ACK);
  			if(isMaster()) {
+ 				// Reached to the top of the tree, multicast the ack. 
 				smList.sendToSlaves(ack);
 				registEditor(forwarder,ack);
+	 			if (forwarder.isDirect()) {
+	 				// If put editor on the master, no SMCMD_PUT_ACK is
+	 				// generated. Send ack to the editor now.
+	 				forwarder.send(ack);
+	 			}
 			} else {
+				// Pass this to the master.
 				smList.sendToMaster(command);
 				// registEditor will be done by SMCMD_PUT_ACK
 			}
- 			if (forwarder.isDirect()) {
- 				forwarder.send(ack);
- 			}
 			updateGUI();
 	
 		}