Mercurial > hg > RemoteEditor > REPSessionManager
changeset 454:234dd2c88f0f
resend after merge fix
author | one |
---|---|
date | Thu, 23 Sep 2010 23:17:20 +0900 |
parents | 7005658aa52a |
children | 15c70d5e8886 |
files | rep/handler/Editor.java |
diffstat | 1 files changed, 15 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- 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<PacketSet> w = waitingCommandInMerge; - waitingCommandInMerge = new LinkedList<PacketSet>(); - 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);