Skip to content

Commit a2d5234

Browse files
committed
failed websocket connections shold be closed
1 parent a10143f commit a2d5234

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

AndroidAsync/src/com/koushikdutta/async/Util.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ public static void emitAllData(DataEmitter emitter, ByteBufferList list) {
5151
if (SUPRESS_DEBUG_EXCEPTIONS)
5252
return;
5353
assert false;
54-
throw new RuntimeException("Not all data was consumed by Util.emitAllData");
54+
throw new AssertionError("Not all data was consumed by Util.emitAllData");
5555
}
5656
}
5757

AndroidAsync/src/com/koushikdutta/async/http/AsyncHttpClient.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -688,6 +688,7 @@ public Future<WebSocket> websocket(final AsyncHttpRequest req, String[] protocol
688688
WebSocket ws = WebSocketImpl.finishHandshake(req.getHeaders(), response);
689689
if (ws == null) {
690690
ex = new WebSocketHandshakeException("Unable to complete websocket handshake");
691+
response.close();
691692
if (!ret.setComplete(ex))
692693
return;
693694
}

0 commit comments

Comments
 (0)