Skip to content

Commit

Permalink
Improve fix for #1342
Browse files Browse the repository at this point in the history
  • Loading branch information
jfarcand committed Oct 15, 2013
1 parent fae5113 commit 7cbfbc7
Showing 1 changed file with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,16 +193,15 @@ public void onAddAtmosphereResource(Broadcaster b, AtmosphereResource r) {
public void onRemoveAtmosphereResource(Broadcaster b, AtmosphereResource r) {
// We track cancelled and resumed connection only.
BroadcasterTracker t = states.get(r.uuid());

// The BroadcasterTracker was swapped
if (t == null) {
onAddAtmosphereResource(b, r);
}

AtmosphereResourceEvent e = r.getAtmosphereResourceEvent();
if (t != null && (e.isClosedByClient() || !r.isResumed() && !e.isResumedOnTimeout())) {
t.remove(b);
} else {

// The BroadcasterTracker was swapped
if (t == null) {
onAddAtmosphereResource(b, r);
}
logger.trace("Keeping the state of {} with broadcaster {}", r.uuid(), b.getID());
logger.trace("State for {} with broadcaster {}", r.uuid(), t != null ? t.ids() : "null");
}
Expand Down

0 comments on commit 7cbfbc7

Please sign in to comment.