Skip to content

Commit

Permalink
Fix for #505 [websocket] Possible memory leak on Tomcat with WebSocket
Browse files Browse the repository at this point in the history
  • Loading branch information
jfarcand committed Jul 12, 2012
1 parent 4c18af6 commit c26b5b1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1516,7 +1516,6 @@ public final static AtmosphereRequest cloneRequest(HttpServletRequest request, b
if (AtmosphereRequest.class.isAssignableFrom(request.getClass())) {
b = AtmosphereRequest.class.cast(request).b;
isWrapped = true;
r = request;
} else {
b = new Builder();
b.request(request);
Expand All @@ -1535,9 +1534,10 @@ public final static AtmosphereRequest cloneRequest(HttpServletRequest request, b

if (loadInMemory) {
r = new NoOpsRequest();
load(request, b);
if (isWrapped) {
load(b.request, b);
} else {
load(request, b);
}
b.request(r);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,9 @@ protected final void dispatch(final AtmosphereRequest request, final AtmosphereR
return;
}

AtmosphereResource resource = (AtmosphereResource) request.getAttribute(FrameworkConfig.ATMOSPHERE_RESOURCE);

if (r.getStatus() >= 400) {
webSocketProtocol.onError(webSocket, new WebSocketException("Status code higher or equal than 400", r));
}

webSocket.resource(resource);
}

public WebSocket webSocket() {
Expand Down

0 comments on commit c26b5b1

Please sign in to comment.