http-client-branch: (WebSocket) no error after abort http-client-branch
authorprappo
Mon, 19 Mar 2018 19:52:43 +0000
branchhttp-client-branch
changeset 56322 316be30d078d
parent 56321 4c3e5976942a
child 56323 cf43d0ee8959
http-client-branch: (WebSocket) no error after abort
src/java.net.http/share/classes/jdk/internal/net/http/websocket/WebSocketImpl.java
test/jdk/java/net/httpclient/websocket/MockListener.java
--- a/src/java.net.http/share/classes/jdk/internal/net/http/websocket/WebSocketImpl.java	Mon Mar 19 17:04:28 2018 +0000
+++ b/src/java.net.http/share/classes/jdk/internal/net/http/websocket/WebSocketImpl.java	Mon Mar 19 19:52:43 2018 +0000
@@ -456,10 +456,9 @@
         public void run() {
             debug.log(Level.DEBUG, "enter receive task");
             loop:
-            while (true) {
+            while (!receiveScheduler.isStopped()) {
                 State s = state.get();
                 debug.log(Level.DEBUG, "receive state: %s", s);
-
                 try {
                     switch (s) {
                         case OPEN:
--- a/test/jdk/java/net/httpclient/websocket/MockListener.java	Mon Mar 19 17:04:28 2018 +0000
+++ b/test/jdk/java/net/httpclient/websocket/MockListener.java	Mon Mar 19 19:52:43 2018 +0000
@@ -180,6 +180,7 @@
     @Override
     public void onError(WebSocket webSocket, Throwable error) {
         System.out.printf("onError(%s, %s)%n", webSocket, error);
+        error.printStackTrace(System.out);
         OnError inv = new OnError(webSocket, error == null ? null : error.getClass());
         synchronized (invocations) {
             invocations.add(inv);