Mercurial > hg > RemoteEditor > REPSessionManager
changeset 452:d0d2449000f5
checkAck
author | one |
---|---|
date | Thu, 23 Sep 2010 21:19:28 +0900 |
parents | fa7d9ec2008e |
children | 7005658aa52a |
files | rep/handler/Editor.java rep/handler/Translator.java |
diffstat | 2 files changed, 4 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/rep/handler/Editor.java Thu Sep 23 19:51:19 2010 +0900 +++ b/rep/handler/Editor.java Thu Sep 23 21:19:28 2010 +0900 @@ -86,11 +86,10 @@ switch(command.cmd) { case REPCMD_INSERT_ACK: case REPCMD_DELETE_ACK: - if (waitingRequired(command,null)) return; - checkAck(command); if (command.eid==eid) { // Second Phase が終わって同期が終了。 // SessionManager.logger.writeLog("Complete "+command); + checkAck(command); checkQuit(); return; } @@ -116,7 +115,6 @@ return; } else if (command.eid == eid){ // 編集コマンドが一周して来た - if (waitingRequired(command,null)) return; checkReturnedCommand(command); return; } @@ -303,9 +301,8 @@ translator.endMerge(); REPCommand mergeEnd = new REPCommand(REP.SMCMD_END_MERGE,sid,eid,seq(),0,""); sendToEditor(mergeEnd); + checkAck(preMergeCommand); if (preMergeCommand.eid==eid) { - // Ackの場合はcheckAck() で既にremoveされている - if (sentList.getFirst()==mergeMark) sentList.remove(1); else sentList.remove(0); // First Phase End, send ACK REPCommand keep = new REPCommand(preMergeCommand); switch(keep.cmd) { @@ -416,6 +413,7 @@ if (!waitingRequired(command,channel)) { if (isMergeCommand(command)) { merging = true; + ServerMainLoop.logger.writeLog("Editor"+eid+": merging=true "+command); } super.write(command); }
--- a/rep/handler/Translator.java Thu Sep 23 19:51:19 2010 +0900 +++ b/rep/handler/Translator.java Thu Sep 23 21:19:28 2010 +0900 @@ -220,7 +220,7 @@ } public void startMerge(REPCommand cmd) { - logger.writeLog("START MERGE command ="+cmd+ + logger.writeLog("Editor"+eid+": START MERGE command ="+cmd+ ((unMergedCmds.size()>0)?" and top of unMergedCmds = "+ unMergedCmds.getLast():"")); merge_mode = true; }