< prev index next >

test/jdk/java/net/httpclient/http2/server/Http2TestServerConnection.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.

@@ -641,15 +641,25 @@
                             // do orderly close on input q
                             // and close the output q immediately
                             // This should mean depending on what the
                             // handler is doing: either an EOF on read
                             // or an IOException if writing the response.
+                            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);
                         }
                     }
                 }
< prev index next >