Skip to content

Commit

Permalink
Fix for #678
Browse files Browse the repository at this point in the history
  • Loading branch information
jfarcand committed Oct 11, 2012
1 parent 3c0ca44 commit ef1fbef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -331,6 +331,9 @@ public Action resumed(AtmosphereRequest request, AtmosphereResponse response)

AtmosphereResourceImpl r =
(AtmosphereResourceImpl) request.getAttribute(FrameworkConfig.ATMOSPHERE_RESOURCE);

if (r == null) return Action.CANCELLED; // We are cancelled already

AtmosphereHandler atmosphereHandler =
(AtmosphereHandler)
request.getAttribute(FrameworkConfig.ATMOSPHERE_HANDLER);
Expand Down Expand Up @@ -538,7 +541,7 @@ public Action cancelled(AtmosphereRequest req, AtmosphereResponse res)
r.cancel();
}
} catch (Throwable t) {
logger.trace("cancel", t);
logger.debug("cancel", t);
} finally {
if (r != null) {
destroyResource(r);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
import java.util.concurrent.TimeUnit;
import java.util.concurrent.atomic.AtomicBoolean;

import static org.atmosphere.cpr.ApplicationConfig.SUSPENDED_ATMOSPHERE_RESOURCE_UUID;
import static org.atmosphere.cpr.HeaderConfig.ACCESS_CONTROL_ALLOW_CREDENTIALS;
import static org.atmosphere.cpr.HeaderConfig.ACCESS_CONTROL_ALLOW_ORIGIN;
import static org.atmosphere.cpr.HeaderConfig.CACHE_CONTROL;
Expand Down Expand Up @@ -132,7 +133,10 @@ public AtmosphereResourceImpl(AtmosphereConfig config, Broadcaster broadcaster,
this.atmosphereHandler = atmosphereHandler;
this.event = new AtmosphereResourceEventImpl(this);

String s = response.getHeader(HeaderConfig.X_ATMOSPHERE_TRACKING_ID);
String s = (String) req.getAttribute(SUSPENDED_ATMOSPHERE_RESOURCE_UUID);
if (s == null) {
s = response.getHeader(HeaderConfig.X_ATMOSPHERE_TRACKING_ID);
}
uuid = s == null ? UUID.randomUUID().toString() : s;

if (config.isSupportSession()) {
Expand Down

0 comments on commit ef1fbef

Please sign in to comment.