# HG changeset patch # User one # Date 1285251440 -32400 # Node ID 234dd2c88f0f8064135b7f80d382c5cca2fdc2d6 # Parent 7005658aa52a1f6393d1024ee99fbe2f62cd432b resend after merge fix diff -r 7005658aa52a -r 234dd2c88f0f rep/handler/Editor.java --- a/rep/handler/Editor.java Thu Sep 23 22:19:04 2010 +0900 +++ b/rep/handler/Editor.java Thu Sep 23 23:17:20 2010 +0900 @@ -485,20 +485,24 @@ */ public void checkWaitingCommandInMerge() { if (translator==null||isMerging()) return; - LinkedList w = waitingCommandInMerge; - waitingCommandInMerge = new LinkedList(); - while(w.size()>0) { - if (isMerging()) { - w.addAll(waitingCommandInMerge); - waitingCommandInMerge = w; + while(waitingCommandInMerge.size()>0) { + if (merging || isMerging()) { return; } - PacketSet p = w.remove(0); + PacketSet p = waitingCommandInMerge.remove(0); + REPCommand command = p.command; try { - if (p.channel!=null) - write(p.command); - else - manage(p.command); + if (p.channel!=null) { + ServerMainLoop.logger.writeLog("Editor"+eid+": resend after merge comand="+command); + toEditor.send(command); + if (isMergeCommand(command)) { + merging = true; + return; + } + } else { + assert(false); + manage(command); + } } catch (Exception e1) { assert false; manager.close(p.channel.channel);