< prev index next >

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

Print this page

        

*** 1,7 **** /* ! * Copyright (c) 2016, 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. --- 1,7 ---- /* ! * Copyright (c) 2016, 2017, 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.
*** 21,33 **** * questions. */ import java.io.*; import java.nio.ByteBuffer; - import jdk.incubator.http.internal.common.ByteBufferReference; - import jdk.incubator.http.internal.common.Queue; import jdk.incubator.http.internal.common.Utils; import jdk.incubator.http.internal.frame.DataFrame; import jdk.incubator.http.internal.frame.Http2Frame; import jdk.incubator.http.internal.frame.ResetFrame; --- 21,32 ---- * questions. */ import java.io.*; import java.nio.ByteBuffer; + import java.util.List; import jdk.incubator.http.internal.common.Utils; import jdk.incubator.http.internal.frame.DataFrame; import jdk.incubator.http.internal.frame.Http2Frame; import jdk.incubator.http.internal.frame.ResetFrame;
*** 61,73 **** return null; } Http2Frame frame; do { frame = q.take(); - if (frame.type() == ResetFrame.TYPE) { - conn.handleStreamReset((ResetFrame) frame); // throws IOException - } // ignoring others for now Wupdates handled elsewhere if (frame.type() != DataFrame.TYPE) { System.out.println("Ignoring " + frame.toString() + " CHECK THIS"); } } while (frame.type() != DataFrame.TYPE); --- 60,69 ----
*** 85,101 **** if (nextIndex == -1 || nextIndex == buffers.length) { DataFrame df = getData(); if (df == null) { return null; } ! ByteBufferReference[] data = df.getData(); ! int len = Utils.remaining(data); if ((len == 0) && eof) { return null; } ! buffers = ByteBufferReference.toBuffers(data); nextIndex = 0; } buffer = buffers[nextIndex++]; } return buffer; --- 81,97 ---- if (nextIndex == -1 || nextIndex == buffers.length) { DataFrame df = getData(); if (df == null) { return null; } ! List<ByteBuffer> data = df.getData(); ! long len = Utils.remaining(data); if ((len == 0) && eof) { return null; } ! buffers = data.toArray(Utils.EMPTY_BB_ARRAY); nextIndex = 0; } buffer = buffers[nextIndex++]; } return buffer;
< prev index next >