test/jdk/java/net/httpclient/http2/server/Http2TestServerConnection.java
branchhttp-client-branch
changeset 56019 2cb33775fc6f
parent 56009 cf8792f51dee
parent 48523 b95b08f3e1a8
child 56082 1da51fab3032
--- a/test/jdk/java/net/httpclient/http2/server/Http2TestServerConnection.java	Tue Jan 16 15:52:01 2018 +0000
+++ b/test/jdk/java/net/httpclient/http2/server/Http2TestServerConnection.java	Wed Jan 17 12:19:06 2018 +0000
@@ -643,11 +643,21 @@
                             // This should mean depending on what the
                             // handler is doing: either an EOF on read
                             // or an IOException if writing the response.
-                            q.orderlyClose();
-                            BodyOutputStream oq = outStreams.get(stream);
-                            if (oq != null)
-                                oq.closeInternal();
-
+                            if (q != null) {
+                                q.orderlyClose();
+                                BodyOutputStream oq = outStreams.get(stream);
+                                if (oq != null)
+                                    oq.closeInternal();
+                            } else if (pushStreams.contains(stream)) {
+                                // we could interrupt the pushStream's output
+                                // but the continuation, even after a reset
+                                // should be handle gracefully by the client
+                                // anyway.
+                            } else {
+                                System.err.println("TestServer: Unexpected frame on: " + stream);
+                                System.err.println(frame);
+                                throw new IOException("Unexpected frame");
+                            }
                         } else {
                             q.put(frame);
                         }