Skip to content

Commit

Permalink
Fix for #983
Browse files Browse the repository at this point in the history
  • Loading branch information
jfarcand committed Mar 27, 2013
1 parent b01ff51 commit c0214a6
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@
import org.atmosphere.cpr.AtmosphereInterceptor;
import org.atmosphere.cpr.AtmosphereRequest;
import org.atmosphere.cpr.AtmosphereResource;
import org.atmosphere.cpr.AtmosphereResourceEvent;
import org.atmosphere.cpr.AtmosphereResourceEventImpl;
import org.atmosphere.cpr.AtmosphereResourceEventListenerAdapter;
import org.atmosphere.cpr.AtmosphereResourceFactory;
import org.atmosphere.cpr.AtmosphereResourceImpl;
import org.atmosphere.cpr.HeaderConfig;
Expand Down Expand Up @@ -56,9 +54,13 @@ public Action inspect(final AtmosphereResource r) {
if (ss != null) {
ss.notifyListeners(new AtmosphereResourceEventImpl(AtmosphereResourceImpl.class.cast(r), true, false));
try {
ss.getRequest().setAttribute(AtmosphereResourceImpl.PRE_SUSPEND, "");
AtmosphereResourceImpl.class.cast(ss).cancel();
} catch (IOException e) {
try {
// https://github.com/Atmosphere/atmosphere/issues/983
ss.getRequest().setAttribute(AtmosphereResourceImpl.PRE_SUSPEND, "");
} finally {
AtmosphereResourceImpl.class.cast(ss).cancel();
}
} catch (Throwable e) {
logger.trace("", e);
}
}
Expand All @@ -71,7 +73,7 @@ public Action inspect(final AtmosphereResource r) {
public void postInspect(AtmosphereResource r) {
}

public String toString(){
public String toString() {
return "Browser disconnection detection";
}
}

0 comments on commit c0214a6

Please sign in to comment.