Permalink
Browse files

Fixes COMETD-361 (OortComet may not be disconnected on Oort shutdown).

  • Loading branch information...
1 parent 7c14c06 commit b0fc8089b63d88101ebb6576335d3cb4b7c17e79 Simone Bordet committed Apr 12, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 cometd-java/cometd-java-oort/src/main/java/org/cometd/oort/Oort.java
@@ -972,9 +972,10 @@ public void onMessage(ClientSessionChannel channel, Message message)
{
debug("Disconnecting pending comet {}", cometURL);
comet.disconnect();
- // Fall through: if it was an alias URL the message will
- // have the extension and we can map it, otherwise there
- // will be no extension and we return
+ // Fall through to process an eventual extension:
+ // if it was an alias URL the message will have
+ // the extension and we can map it, otherwise
+ // there will be no extension and we return
}
}
}
@@ -1009,7 +1010,8 @@ public void onMessage(ClientSessionChannel channel, Message message)
// Remove the pending comet as last step, so that if there is a concurrent
// call to observeComet() we are sure that we always return either the
// pending OortComet, or the connected one from the _clientComets field
- _pendingComets.remove(cometURL);
+ if (message.isSuccessful() || comet != null && comet.isDisconnected())
+ _pendingComets.remove(cometURL);
}
}
}

0 comments on commit b0fc808

Please sign in to comment.