http-client-branch: (cleanup) unused imports, unused methods, removed 1 class; typos;
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/AbstractAsyncSSLConnection.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/AbstractAsyncSSLConnection.java Thu Nov 09 15:24:39 2017 +0300
@@ -91,8 +91,8 @@
final SSLEngine getEngine() { return engine; }
- @Override
- SSLParameters sslParameters() { return sslParameters; }
+// @Override
+// SSLParameters sslParameters() { return sslParameters; }
private static SSLParameters createSSLParameters(HttpClientImpl client,
SSLContext context,
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Exchange.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Exchange.java Thu Nov 09 15:24:39 2017 +0300
@@ -28,7 +28,6 @@
import java.io.IOException;
import java.lang.System.Logger.Level;
import java.net.InetSocketAddress;
-import java.net.Proxy;
import java.net.ProxySelector;
import java.net.SocketPermission;
import java.net.URI;
@@ -513,41 +512,41 @@
return null;
}
- HttpClient.Redirect followRedirects() {
- return client.followRedirects();
- }
+// HttpClient.Redirect followRedirects() {
+// return client.followRedirects();
+// }
HttpClient.Version version() {
return multi.version();
}
- private static SocketPermission getSocketPermissionFor(URI url) {
- if (System.getSecurityManager() == null) {
- return null;
- }
+// private static SocketPermission getSocketPermissionFor(URI url) {
+// if (System.getSecurityManager() == null) {
+// return null;
+// }
+//
+// StringBuilder sb = new StringBuilder();
+// String host = url.getHost();
+// sb.append(host);
+// int port = url.getPort();
+// if (port == -1) {
+// String scheme = url.getScheme();
+// if ("http".equals(scheme)) {
+// sb.append(":80");
+// } else { // scheme must be https
+// sb.append(":443");
+// }
+// } else {
+// sb.append(':')
+// .append(Integer.toString(port));
+// }
+// String target = sb.toString();
+// return new SocketPermission(target, "connect");
+// }
- StringBuilder sb = new StringBuilder();
- String host = url.getHost();
- sb.append(host);
- int port = url.getPort();
- if (port == -1) {
- String scheme = url.getScheme();
- if ("http".equals(scheme)) {
- sb.append(":80");
- } else { // scheme must be https
- sb.append(":443");
- }
- } else {
- sb.append(':')
- .append(Integer.toString(port));
- }
- String target = sb.toString();
- return new SocketPermission(target, "connect");
- }
-
- AccessControlContext getAccessControlContext() {
- return acc;
- }
+// AccessControlContext getAccessControlContext() {
+// return acc;
+// }
String dbgString() {
return dbgTag;
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HeaderParser.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HeaderParser.java Thu Nov 09 15:24:39 2017 +0300
@@ -58,26 +58,26 @@
parse();
}
- private HeaderParser () { }
+// private HeaderParser () { }
- /**
- * Creates a new HeaderParser from this, whose keys (and corresponding
- * values) range from "start" to "end-1"
- */
- public HeaderParser subsequence(int start, int end) {
- if (start == 0 && end == nkeys) {
- return this;
- }
- if (start < 0 || start >= end || end > nkeys) {
- throw new IllegalArgumentException("invalid start or end");
- }
- HeaderParser n = new HeaderParser();
- n.tab = new String [asize][2];
- n.asize = asize;
- System.arraycopy (tab, start, n.tab, 0, (end-start));
- n.nkeys= (end-start);
- return n;
- }
+// /**
+// * Creates a new HeaderParser from this, whose keys (and corresponding
+// * values) range from "start" to "end-1"
+// */
+// public HeaderParser subsequence(int start, int end) {
+// if (start == 0 && end == nkeys) {
+// return this;
+// }
+// if (start < 0 || start >= end || end > nkeys) {
+// throw new IllegalArgumentException("invalid start or end");
+// }
+// HeaderParser n = new HeaderParser();
+// n.tab = new String [asize][2];
+// n.asize = asize;
+// System.arraycopy (tab, start, n.tab, 0, (end-start));
+// n.nkeys= (end-start);
+// return n;
+// }
private void parse() {
@@ -216,9 +216,9 @@
return new ParserIterator (false);
}
- public Iterator<String> values () {
- return new ParserIterator (true);
- }
+// public Iterator<String> values () {
+// return new ParserIterator (true);
+// }
@Override
public String toString () {
@@ -242,11 +242,11 @@
return sb.toString();
}
- public int findInt(String k, int Default) {
- try {
- return Integer.parseInt(findValue(k, String.valueOf(Default)));
- } catch (Throwable t) {
- return Default;
- }
- }
+// public int findInt(String k, int Default) {
+// try {
+// return Integer.parseInt(findValue(k, String.valueOf(Default)));
+// } catch (Throwable t) {
+// return Default;
+// }
+// }
}
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http1AsyncReceiver.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http1AsyncReceiver.java Thu Nov 09 15:24:39 2017 +0300
@@ -39,7 +39,6 @@
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.AtomicReference;
-import java.util.function.Supplier;
import java.util.stream.Collectors;
import jdk.incubator.http.internal.common.Demand;
import jdk.incubator.http.internal.common.FlowTube.TubeSubscriber;
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http1HeaderParser.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http1HeaderParser.java Thu Nov 09 15:24:39 2017 +0300
@@ -61,8 +61,8 @@
private State state = State.STATUS_LINE;
- /** Returns the status-line. */
- String statusLine() { return statusLine; }
+// /** Returns the status-line. */
+// String statusLine() { return statusLine; }
/** Returns the response code. */
int responseCode() { return responseCode; }
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http1Response.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http1Response.java Thu Nov 09 15:24:39 2017 +0300
@@ -251,19 +251,19 @@
}
}
- private void logHeaders(ResponseHeaders headers) {
- StringBuilder sb = new StringBuilder("RESPONSE HEADERS:\n");
- Log.dumpHeaders(sb, " ", headers);
- Log.logHeaders(sb.toString());
- }
+// private void logHeaders(ResponseHeaders headers) {
+// StringBuilder sb = new StringBuilder("RESPONSE HEADERS:\n");
+// Log.dumpHeaders(sb, " ", headers);
+// Log.logHeaders(sb.toString());
+// }
- Response response() {
- return response;
- }
+// Response response() {
+// return response;
+// }
- boolean redirecting() {
- return redirecting;
- }
+// boolean redirecting() {
+// return redirecting;
+// }
HttpHeaders responseHeaders() {
return headers;
@@ -273,8 +273,8 @@
return responseCode;
}
- static final char CR = '\r';
- static final char LF = '\n';
+// static final char CR = '\r';
+// static final char LF = '\n';
// ================ Support for plugging into AsyncConnection =================
// ============================================================================
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http2ClientImpl.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http2ClientImpl.java Thu Nov 09 15:24:39 2017 +0300
@@ -78,9 +78,9 @@
}
}
- boolean haveConnectionFor(URI uri, InetSocketAddress proxy) {
- return connections.containsKey(Http2Connection.keyFor(uri,proxy));
- }
+// boolean haveConnectionFor(URI uri, InetSocketAddress proxy) {
+// return connections.containsKey(Http2Connection.keyFor(uri,proxy));
+// }
/**
* If a https request then async waits until a connection is opened.
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http2Connection.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Http2Connection.java Thu Nov 09 15:24:39 2017 +0300
@@ -38,17 +38,14 @@
import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.ArrayList;
-import java.util.Formatter;
import java.util.Objects;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Flow;
import java.util.function.Function;
import java.util.function.Supplier;
-import java.util.stream.Collectors;
import javax.net.ssl.SSLEngine;
import jdk.incubator.http.internal.common.*;
-import jdk.incubator.http.internal.common.SequentialScheduler;
import jdk.incubator.http.internal.common.FlowTube.TubeSubscriber;
import jdk.incubator.http.internal.frame.*;
import jdk.incubator.http.internal.hpack.Encoder;
@@ -430,36 +427,36 @@
client2.putConnection(this);
}
- private static String toHexdump1(ByteBuffer bb) {
- bb.mark();
- StringBuilder sb = new StringBuilder(512);
- Formatter f = new Formatter(sb);
-
- while (bb.hasRemaining()) {
- int i = Byte.toUnsignedInt(bb.get());
- f.format("%02x:", i);
- }
- sb.deleteCharAt(sb.length()-1);
- bb.reset();
- return sb.toString();
- }
+// private static String toHexdump1(ByteBuffer bb) {
+// bb.mark();
+// StringBuilder sb = new StringBuilder(512);
+// Formatter f = new Formatter(sb);
+//
+// while (bb.hasRemaining()) {
+// int i = Byte.toUnsignedInt(bb.get());
+// f.format("%02x:", i);
+// }
+// sb.deleteCharAt(sb.length()-1);
+// bb.reset();
+// return sb.toString();
+// }
- private static String toHexdump(ByteBuffer bb) {
- List<String> words = new ArrayList<>();
- int i = 0;
- bb.mark();
- while (bb.hasRemaining()) {
- if (i % 2 == 0) {
- words.add("");
- }
- byte b = bb.get();
- String hex = Integer.toHexString(256 + Byte.toUnsignedInt(b)).substring(1);
- words.set(i / 2, words.get(i / 2) + hex);
- i++;
- }
- bb.reset();
- return words.stream().collect(Collectors.joining(" "));
- }
+// private static String toHexdump(ByteBuffer bb) {
+// List<String> words = new ArrayList<>();
+// int i = 0;
+// bb.mark();
+// while (bb.hasRemaining()) {
+// if (i % 2 == 0) {
+// words.add("");
+// }
+// byte b = bb.get();
+// String hex = Integer.toHexString(256 + Byte.toUnsignedInt(b)).substring(1);
+// words.set(i / 2, words.get(i / 2) + hex);
+// i++;
+// }
+// bb.reset();
+// return words.stream().collect(Collectors.joining(" "));
+// }
private void decodeHeaders(HeaderFrame frame, DecodingCallback decoder)
throws IOException
@@ -484,12 +481,12 @@
sendFrame(f);
}
- private final ByteBufferPool readBufferPool = new ByteBufferPool();
+// private final ByteBufferPool readBufferPool = new ByteBufferPool();
- // provides buffer to read data (default size)
- public ByteBufferReference getReadBuffer() {
- return readBufferPool.get(getMaxReceiveFrameSize() + Http2Frame.FRAME_HEADER_SIZE);
- }
+// // provides buffer to read data (default size)
+// public ByteBufferReference getReadBuffer() {
+// return readBufferPool.get(getMaxReceiveFrameSize() + Http2Frame.FRAME_HEADER_SIZE);
+// }
long count;
final void asyncReceive(ByteBufferReference buffer) {
@@ -783,10 +780,10 @@
return clientSettings.getParameter(MAX_FRAME_SIZE);
}
- // Not sure how useful this is.
- public int getMaxHeadersSize() {
- return serverSettings.getParameter(MAX_HEADER_LIST_SIZE);
- }
+// // Not sure how useful this is.
+// public int getMaxHeadersSize() {
+// return serverSettings.getParameter(MAX_HEADER_LIST_SIZE);
+// }
private static final String CLIENT_PREFACE = "PRI * HTTP/2.0\r\n\r\nSM\r\n\r\n";
@@ -854,16 +851,16 @@
streams.put(streamid, stream);
}
- void deleteStream(int streamid) {
- if (streams.remove(streamid) != null) {
- // decrement the reference count on the HttpClientImpl
- // to allow the SelectorManager thread to exit if no
- // other operation is pending and the facade is no
- // longer referenced.
- client().unreference();
- }
- windowController.removeStream(streamid);
- }
+// void deleteStream(int streamid) {
+// if (streams.remove(streamid) != null) {
+// // decrement the reference count on the HttpClientImpl
+// // to allow the SelectorManager thread to exit if no
+// // other operation is pending and the facade is no
+// // longer referenced.
+// client().unreference();
+// }
+// windowController.removeStream(streamid);
+// }
/**
* Encode the headers into a List<ByteBuffer> and then create HEADERS
@@ -954,18 +951,18 @@
return framesEncoder.encodeFrames(frames);
}
- static Throwable getExceptionFrom(CompletableFuture<?> cf) {
- try {
- cf.get();
- return null;
- } catch (Throwable e) {
- if (e.getCause() != null) {
- return e.getCause();
- } else {
- return e;
- }
- }
- }
+// static Throwable getExceptionFrom(CompletableFuture<?> cf) {
+// try {
+// cf.get();
+// return null;
+// } catch (Throwable e) {
+// if (e.getCause() != null) {
+// return e.getCause();
+// } else {
+// return e;
+// }
+// }
+// }
private Stream<?> registerNewStream(OutgoingHeaders<Stream<?>> oh) {
Stream<?> stream = oh.getAttachment();
@@ -1036,13 +1033,13 @@
}
}
- /**
- * Returns the TubeSubscriber for reading from the connection flow.
- * @return the TubeSubscriber for reading from the connection flow.
- */
- TubeSubscriber subscriber() {
- return subscriber;
- }
+// /**
+// * Returns the TubeSubscriber for reading from the connection flow.
+// * @return the TubeSubscriber for reading from the connection flow.
+// */
+// TubeSubscriber subscriber() {
+// return subscriber;
+// }
/**
* A simple tube subscriber for reading from the connection flow.
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpClientImpl.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpClientImpl.java Thu Nov 09 15:24:39 2017 +0300
@@ -33,7 +33,6 @@
import java.net.Authenticator;
import java.net.CookieManager;
import java.net.NetPermission;
-import java.net.Proxy;
import java.net.ProxySelector;
import java.net.URI;
import java.nio.channels.CancelledKeyException;
@@ -45,7 +44,6 @@
import java.security.AccessControlContext;
import java.security.AccessController;
import java.security.NoSuchAlgorithmException;
-import java.security.PrivilegedAction;
import java.time.Instant;
import java.time.temporal.ChronoUnit;
import java.util.ArrayList;
@@ -510,7 +508,7 @@
private static final int DEF_NODEADLINE = 3000; // ms
private static final long NODEADLINE; // default is DEF_NODEADLINE ms
static {
- // ensure NODEADLINE is inialized with some valid value.
+ // ensure NODEADLINE is initialized with some valid value.
long deadline = Utils.getIntegerNetProperty(
"jdk.httpclient.internal.selector.timeout",
DEF_NODEADLINE); // millis
@@ -743,16 +741,16 @@
}
}
- void debugPrint(Selector selector) {
- System.err.println("Selector: debugprint start");
- Set<SelectionKey> keys = selector.keys();
- for (SelectionKey key : keys) {
- SelectableChannel c = key.channel();
- int ops = key.interestOps();
- System.err.printf("selector chan:%s ops:%d\n", c, ops);
- }
- System.err.println("Selector: debugprint end");
- }
+// void debugPrint(Selector selector) {
+// System.err.println("Selector: debugprint start");
+// Set<SelectionKey> keys = selector.keys();
+// for (SelectionKey key : keys) {
+// SelectableChannel c = key.channel();
+// int ops = key.interestOps();
+// System.err.printf("selector chan:%s ops:%d\n", c, ops);
+// }
+// System.err.println("Selector: debugprint end");
+// }
/** Handles the given event. The given ioe may be null. */
void handleEvent(AsyncEvent event, IOException ioe) {
@@ -939,9 +937,9 @@
//private final HashMap<String, Boolean> http2NotSupported = new HashMap<>();
- boolean getHttp2Allowed() {
- return version.equals(Version.HTTP_2);
- }
+// boolean getHttp2Allowed() {
+// return version.equals(Version.HTTP_2);
+// }
private void initFilters() {
addFilter(AuthenticationFilter.class);
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpConnection.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpConnection.java Thu Nov 09 15:24:39 2017 +0300
@@ -25,7 +25,6 @@
package jdk.incubator.http;
-import javax.net.ssl.SSLParameters;
import java.io.Closeable;
import java.io.IOException;
import java.lang.System.Logger.Level;
@@ -97,9 +96,9 @@
trailingOperations.add(cf);
}
- final void removeTrailingOperation(CompletableFuture<?> cf) {
- trailingOperations.remove(cf);
- }
+// final void removeTrailingOperation(CompletableFuture<?> cf) {
+// trailingOperations.remove(cf);
+// }
final HttpClientImpl client() {
return client;
@@ -141,8 +140,6 @@
* is one of the following:
* {@link PlainHttpConnection}
* {@link PlainTunnelingConnection}
- * {@link SSLConnection}
- * {@link SSLTunnelConnection}
*
* The returned connection, if not from the connection pool, must have its,
* connect() or connectAsync() method invoked, which ( when it completes
@@ -251,10 +248,10 @@
abstract ConnectionPool.CacheKey cacheKey();
- // overridden in SSL only
- SSLParameters sslParameters() {
- return null;
- }
+// // overridden in SSL only
+// SSLParameters sslParameters() {
+// return null;
+// }
/**
* Closes this connection, by returning the socket to its connection pool.
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpResponseImpl.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/HttpResponseImpl.java Thu Nov 09 15:24:39 2017 +0300
@@ -31,7 +31,6 @@
import java.util.concurrent.CompletableFuture;
import java.util.function.Supplier;
import javax.net.ssl.SSLParameters;
-import jdk.incubator.http.internal.common.Log;
import jdk.incubator.http.internal.websocket.RawChannel;
/**
@@ -70,26 +69,26 @@
this.body = body;
}
- // A response to a PUSH_PROMISE
- public HttpResponseImpl(Response response,
- HttpRequestImpl pushRequest,
- ImmutableHeaders headers,
- Stream<T> stream,
- SSLParameters sslParameters,
- T body) {
- this.responseCode = response.statusCode();
- this.exchange = null;
- this.initialRequest = null; // ## fix this
- this.finalRequest = pushRequest;
- this.headers = headers;
- //this.trailers = null;
- this.sslParameters = sslParameters;
- this.uri = finalRequest.uri(); // TODO: take from headers
- this.version = HttpClient.Version.HTTP_2;
- this.connection = stream.connection();
- this.stream = stream;
- this.body = body;
- }
+// // A response to a PUSH_PROMISE
+// public HttpResponseImpl(Response response,
+// HttpRequestImpl pushRequest,
+// ImmutableHeaders headers,
+// Stream<T> stream,
+// SSLParameters sslParameters,
+// T body) {
+// this.responseCode = response.statusCode();
+// this.exchange = null;
+// this.initialRequest = null; // ## fix this
+// this.finalRequest = pushRequest;
+// this.headers = headers;
+// //this.trailers = null;
+// this.sslParameters = sslParameters;
+// this.uri = finalRequest.uri(); // TODO: take from headers
+// this.version = HttpClient.Version.HTTP_2;
+// this.connection = stream.connection();
+// this.stream = stream;
+// this.body = body;
+// }
private ExchangeImpl<?> exchangeImpl() {
return exchange != null ? exchange.exchImpl : stream;
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ImmutableHeaders.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ImmutableHeaders.java Thu Nov 09 15:24:39 2017 +0300
@@ -28,11 +28,8 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
-import java.util.Optional;
-import java.util.OptionalLong;
import java.util.TreeMap;
import java.util.function.Predicate;
-import static java.util.Collections.emptyList;
import static java.util.Collections.emptyMap;
import static java.util.Collections.unmodifiableList;
import static java.util.Collections.unmodifiableMap;
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/MultiExchange.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/MultiExchange.java Thu Nov 09 15:24:39 2017 +0300
@@ -144,9 +144,9 @@
this.responseHandler = pushGroup.mainResponseHandler();
}
- CompletableFuture<Void> multiCompletionCF() {
- return pushGroup.groupResult();
- }
+// CompletableFuture<Void> multiCompletionCF() {
+// return pushGroup.groupResult();
+// }
private synchronized Exchange<T> getExchange() {
return exchange;
@@ -156,9 +156,9 @@
return client;
}
- HttpClient.Redirect followRedirects() {
- return client.followRedirects();
- }
+// HttpClient.Redirect followRedirects() {
+// return client.followRedirects();
+// }
HttpClient.Version version() {
return request.version().orElse(client.version());
@@ -201,10 +201,10 @@
return null;
}
- public void cancel() {
- cancelled = true;
- getExchange().cancel();
- }
+// public void cancel() {
+// cancelled = true;
+// getExchange().cancel();
+// }
public void cancel(IOException cause) {
cancelled = true;
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/RequestPublishers.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/RequestPublishers.java Thu Nov 09 15:24:39 2017 +0300
@@ -42,7 +42,6 @@
import java.util.Iterator;
import java.util.List;
import java.util.NoSuchElementException;
-import java.util.Objects;
import java.util.concurrent.ConcurrentLinkedQueue;
import java.util.concurrent.Flow;
import java.util.function.Supplier;
@@ -271,9 +270,9 @@
this.bufSupplier = bufSupplier;
}
- Throwable error() {
- return error;
- }
+// Throwable error() {
+// return error;
+// }
private int read() {
nextBuffer = bufSupplier.get();
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Response.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Response.java Thu Nov 09 15:24:39 2017 +0300
@@ -61,9 +61,9 @@
return headers;
}
- Exchange<?> exchange() {
- return exchange;
- }
+// Exchange<?> exchange() {
+// return exchange;
+// }
int statusCode() {
return statusCode;
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ResponseContent.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ResponseContent.java Thu Nov 09 15:24:39 2017 +0300
@@ -113,7 +113,7 @@
}
- static enum ChunkState {READING_LENGTH, READING_DATA, DONE};
+ static enum ChunkState {READING_LENGTH, READING_DATA, DONE}
class ChunkedBodyParser implements BodyParser {
final ByteBuffer READMORE = Utils.EMPTY_BYTEBUFFER;
final Consumer<Throwable> onComplete;
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ResponseHeaders.java Wed Nov 08 22:51:18 2017 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
@@ -1,200 +0,0 @@
-/*
- * Copyright (c) 2015, 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. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-
-package jdk.incubator.http;
-
-import sun.net.www.MessageHeader;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.ProtocolException;
-import java.nio.ByteBuffer;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Locale;
-import java.util.Map;
-import java.util.Optional;
-import java.util.OptionalLong;
-
-import static java.lang.String.format;
-import static jdk.incubator.http.internal.common.Utils.isValidName;
-import static jdk.incubator.http.internal.common.Utils.isValidValue;
-import static java.util.Objects.requireNonNull;
-
-
-// ####: Remove. Replaced with Http1HeaderDecoder
-
-/*
- * Reads entire header block off channel, in blocking mode.
- * This class is not thread-safe.
- */
-final class ResponseHeaders extends HttpHeaders {
-
- private static final char CR = '\r';
- private static final char LF = '\n';
-
- private final ImmutableHeaders delegate;
-
- /*
- * This constructor takes a connection from which the header block is read
- * and a buffer which may contain an initial portion of this header block.
- *
- * After the headers have been parsed (this constructor has returned) the
- * leftovers (i.e. data, if any, beyond the header block) are accessible
- * from this same buffer from its position to its limit.
- */
- ResponseHeaders(BufferReader reader, ByteBuffer buffer) throws IOException {
- requireNonNull(reader);
- requireNonNull(buffer);
- InputStreamWrapper input =
- new InputStreamWrapper(reader, buffer);
- delegate = ImmutableHeaders.of(parse(input));
- }
-
- @FunctionalInterface
- static interface BufferReader {
- ByteBuffer read() throws IOException;
- }
-
- static final class InputStreamWrapper extends InputStream {
- final BufferReader reader;
- ByteBuffer buffer;
- int lastRead = -1; // last byte read from the buffer
- int consumed = 0; // number of bytes consumed.
- InputStreamWrapper(BufferReader reader, ByteBuffer buffer) {
- super();
- this.reader = reader;
- this.buffer = buffer;
- }
- @Override
- public int read() throws IOException {
- if (!buffer.hasRemaining()) {
- buffer = reader.read();
- if (buffer == null) {
- return lastRead = -1;
- }
- }
- // don't let consumed become positive again if it overflowed
- // we just want to make sure that consumed == 1 really means
- // that only one byte was consumed.
- if (consumed >= 0) consumed++;
- return lastRead = buffer.get();
- }
- }
-
- private static void display(Map<String, List<String>> map) {
- map.forEach((k,v) -> {
- System.out.print (k + ": ");
- for (String val : v) {
- System.out.print(val + ", ");
- }
- System.out.println("");
- });
- }
-
- private Map<String, List<String>> parse(InputStreamWrapper input)
- throws IOException
- {
- // The bulk of work is done by this time-proven class
- MessageHeader h = new MessageHeader();
- h.parseHeader(input);
-
- // When there are no headers (and therefore no body), the status line
- // will be followed by an empty CRLF line.
- // In that case MessageHeader.parseHeader() will consume the first
- // CR character and stop there. In this case we must consume the
- // remaining LF.
- if (input.consumed == 1 && CR == (char) input.lastRead) {
- // MessageHeader will not consume LF if the first character it
- // finds is CR. This only happens if there are no headers, and
- // only one byte will be consumed from the buffer. In this case
- // the next byte MUST be LF
- if (input.read() != LF) {
- throw new IOException("Unexpected byte sequence when no headers: "
- + ((int)CR) + " " + input.lastRead
- + "(" + ((int)CR) + " " + ((int)LF) + " expected)");
- }
- }
-
- Map<String, List<String>> rawHeaders = h.getHeaders();
-
- // Now some additional post-processing to adapt the results received
- // from MessageHeader to what is needed here
- Map<String, List<String>> cookedHeaders = new HashMap<>();
- for (Map.Entry<String, List<String>> e : rawHeaders.entrySet()) {
- String key = e.getKey();
- if (key == null) {
- throw new ProtocolException("Bad header-field");
- }
- if (!isValidName(key)) {
- throw new ProtocolException(format(
- "Bad header-name: '%s'", key));
- }
- List<String> newValues = e.getValue();
- for (String v : newValues) {
- if (!isValidValue(v)) {
- throw new ProtocolException(format(
- "Bad header-value for header-name: '%s'", key));
- }
- }
- String k = key.toLowerCase(Locale.US);
- cookedHeaders.merge(k, newValues,
- (v1, v2) -> {
- ArrayList<String> newV = new ArrayList<>();
- if (v1 != null) {
- newV.addAll(v1);
- }
- newV.addAll(v2);
- return newV;
- });
- }
- return cookedHeaders;
- }
-
- int getContentLength() throws IOException {
- return (int) firstValueAsLong("Content-Length").orElse(-1);
- }
-
- @Override
- public Optional<String> firstValue(String name) {
- return delegate.firstValue(name);
- }
-
- @Override
- public OptionalLong firstValueAsLong(String name) {
- return delegate.firstValueAsLong(name);
- }
-
- @Override
- public List<String> allValues(String name) {
- return delegate.allValues(name);
- }
-
- @Override
- public Map<String, List<String>> map() {
- return delegate.map();
- }
-}
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ResponseSubscribers.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/ResponseSubscribers.java Thu Nov 09 15:24:39 2017 +0300
@@ -27,12 +27,9 @@
import java.io.IOException;
import java.io.InputStream;
-import java.io.UncheckedIOException;
import java.lang.System.Logger.Level;
-import java.net.URI;
import java.nio.ByteBuffer;
import java.nio.channels.FileChannel;
-import java.nio.file.Files;
import java.nio.file.OpenOption;
import java.nio.file.Path;
import java.security.AccessControlContext;
@@ -53,7 +50,6 @@
import java.util.function.Function;
import jdk.incubator.http.internal.common.MinimalFuture;
import jdk.incubator.http.internal.common.Utils;
-import jdk.incubator.http.internal.common.Log;
class ResponseSubscribers {
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLDelegate.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SSLDelegate.java Thu Nov 09 15:24:39 2017 +0300
@@ -28,8 +28,6 @@
import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.channels.SocketChannel;
-import java.util.Arrays;
-import java.util.List;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;
import javax.net.ssl.SSLEngineResult.HandshakeStatus;
@@ -67,34 +65,34 @@
}
// alpn[] may be null
- SSLDelegate(SocketChannel chan, HttpClientImpl client, String[] alpn, String sn)
- throws IOException
- {
- serverName = sn;
- SSLContext context = client.sslContext();
- engine = context.createSSLEngine();
- engine.setUseClientMode(true);
- SSLParameters sslp = client.sslParameters();
- sslParameters = Utils.copySSLParameters(sslp);
- if (sn != null) {
- SNIHostName sni = new SNIHostName(sn);
- sslParameters.setServerNames(List.of(sni));
- }
- if (alpn != null) {
- sslParameters.setApplicationProtocols(alpn);
- Log.logSSL("SSLDelegate: Setting application protocols: {0}" + Arrays.toString(alpn));
- } else {
- Log.logSSL("SSLDelegate: No application protocols proposed");
- }
- engine.setSSLParameters(sslParameters);
- wrapper = new EngineWrapper(chan, engine);
- this.chan = chan;
- this.client = client;
- }
+// SSLDelegate(SocketChannel chan, HttpClientImpl client, String[] alpn, String sn)
+// throws IOException
+// {
+// serverName = sn;
+// SSLContext context = client.sslContext();
+// engine = context.createSSLEngine();
+// engine.setUseClientMode(true);
+// SSLParameters sslp = client.sslParameters();
+// sslParameters = Utils.copySSLParameters(sslp);
+// if (sn != null) {
+// SNIHostName sni = new SNIHostName(sn);
+// sslParameters.setServerNames(List.of(sni));
+// }
+// if (alpn != null) {
+// sslParameters.setApplicationProtocols(alpn);
+// Log.logSSL("SSLDelegate: Setting application protocols: {0}" + Arrays.toString(alpn));
+// } else {
+// Log.logSSL("SSLDelegate: No application protocols proposed");
+// }
+// engine.setSSLParameters(sslParameters);
+// wrapper = new EngineWrapper(chan, engine);
+// this.chan = chan;
+// this.client = client;
+// }
- SSLParameters getSSLParameters() {
- return sslParameters;
- }
+// SSLParameters getSSLParameters() {
+// return sslParameters;
+// }
static long countBytes(ByteBuffer[] buffers, int start, int number) {
long c = 0;
@@ -208,8 +206,8 @@
wrap_dst = allocate(BufType.PACKET);
}
- void close () throws IOException {
- }
+// void close () throws IOException {
+// }
WrapperResult wrapAndSend(ByteBuffer src, boolean ignoreClose)
throws IOException
@@ -323,11 +321,11 @@
}
}
- WrapperResult sendData (ByteBuffer src) throws IOException {
- ByteBuffer[] buffers = new ByteBuffer[1];
- buffers[0] = src;
- return sendData(buffers, 0, 1);
- }
+// WrapperResult sendData (ByteBuffer src) throws IOException {
+// ByteBuffer[] buffers = new ByteBuffer[1];
+// buffers[0] = src;
+// return sendData(buffers, 0, 1);
+// }
/**
* send the data in the given ByteBuffer. If a handshake is needed
@@ -456,29 +454,29 @@
}
}
- static void printParams(SSLParameters p) {
- System.out.println("SSLParameters:");
- if (p == null) {
- System.out.println("Null params");
- return;
- }
- for (String cipher : p.getCipherSuites()) {
- System.out.printf("cipher: %s\n", cipher);
- }
- // JDK 8 EXCL START
- for (String approto : p.getApplicationProtocols()) {
- System.out.printf("application protocol: %s\n", approto);
- }
- // JDK 8 EXCL END
- for (String protocol : p.getProtocols()) {
- System.out.printf("protocol: %s\n", protocol);
- }
- if (p.getServerNames() != null) {
- for (SNIServerName sname : p.getServerNames()) {
- System.out.printf("server name: %s\n", sname.toString());
- }
- }
- }
+// static void printParams(SSLParameters p) {
+// System.out.println("SSLParameters:");
+// if (p == null) {
+// System.out.println("Null params");
+// return;
+// }
+// for (String cipher : p.getCipherSuites()) {
+// System.out.printf("cipher: %s\n", cipher);
+// }
+// // JDK 8 EXCL START
+// for (String approto : p.getApplicationProtocols()) {
+// System.out.printf("application protocol: %s\n", approto);
+// }
+// // JDK 8 EXCL END
+// for (String protocol : p.getProtocols()) {
+// System.out.printf("protocol: %s\n", protocol);
+// }
+// if (p.getServerNames() != null) {
+// for (SNIServerName sname : p.getServerNames()) {
+// System.out.printf("server name: %s\n", sname.toString());
+// }
+// }
+// }
String getSessionInfo() {
StringBuilder sb = new StringBuilder();
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SocketTube.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/SocketTube.java Thu Nov 09 15:24:39 2017 +0300
@@ -77,12 +77,12 @@
this.writeSubscriber = new InternalWriteSubscriber();
}
- private static Flow.Subscription nopSubscription() {
- return new Flow.Subscription() {
- @Override public void request(long n) { }
- @Override public void cancel() { }
- };
- }
+// private static Flow.Subscription nopSubscription() {
+// return new Flow.Subscription() {
+// @Override public void request(long n) { }
+// @Override public void cancel() { }
+// };
+// }
/**
* Returns {@code true} if this flow is finished.
@@ -395,10 +395,10 @@
resumeEvent(writeEvent, this::signalError);
}
- void pauseWriteEvent() {
- debug.log(Level.DEBUG, "pausing write event");
- pauseEvent(writeEvent, this::signalError);
- }
+// void pauseWriteEvent() {
+// debug.log(Level.DEBUG, "pausing write event");
+// pauseEvent(writeEvent, this::signalError);
+// }
void signalWritable() {
debug.log(Level.DEBUG, "channel is writable");
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Stream.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Stream.java Thu Nov 09 15:24:39 2017 +0300
@@ -44,7 +44,6 @@
import java.util.stream.Collectors;
import jdk.incubator.http.internal.common.*;
-import jdk.incubator.http.internal.common.SequentialScheduler;
import jdk.incubator.http.internal.frame.*;
import jdk.incubator.http.internal.hpack.DecodingCallback;
import static java.util.stream.Collectors.toList;
@@ -1054,10 +1053,10 @@
pushCF.completeExceptionally(t);
}
- @Override
- synchronized void responseReceived() {
- super.responseReceived();
- }
+// @Override
+// synchronized void responseReceived() {
+// super.responseReceived();
+// }
// create and return the PushResponseImpl
@Override
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/WindowController.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/WindowController.java Thu Nov 09 15:24:39 2017 +0300
@@ -76,10 +76,10 @@
connectionWindowSize = DEFAULT_INITIAL_WINDOW_SIZE;
}
- /** A Controller with the given initial window size. */
- WindowController(int initialConnectionWindowSize) {
- connectionWindowSize = initialConnectionWindowSize;
- }
+// /** A Controller with the given initial window size. */
+// WindowController(int initialConnectionWindowSize) {
+// connectionWindowSize = initialConnectionWindowSize;
+// }
/** Registers the given stream with this controller. */
void registerStream(int streamid, int initialStreamWindowSize) {
@@ -304,17 +304,17 @@
}
}
- /** Returns the Send Window size for the given stream. */
- int streamWindowSize(int streamid) {
- controllerLock.lock();
- try {
- Integer size = streams.get(streamid);
- if (size == null)
- throw new InternalError("Expected entry for streamid: " + streamid);
- return size;
- } finally {
- controllerLock.unlock();;
- }
- }
+// /** Returns the Send Window size for the given stream. */
+// int streamWindowSize(int streamid) {
+// controllerLock.lock();
+// try {
+// Integer size = streams.get(streamid);
+// if (size == null)
+// throw new InternalError("Expected entry for streamid: " + streamid);
+// return size;
+// } finally {
+// controllerLock.unlock();
+// }
+// }
}
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/ByteBufferReference.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/ByteBufferReference.java Thu Nov 09 15:24:39 2017 +0300
@@ -25,10 +25,8 @@
package jdk.incubator.http.internal.common;
import java.nio.ByteBuffer;
-import java.util.List;
import java.util.Objects;
import java.util.function.Supplier;
-import java.util.stream.Collectors;
public class ByteBufferReference implements Supplier<ByteBuffer> {
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/HttpHeadersImpl.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/HttpHeadersImpl.java Thu Nov 09 15:24:39 2017 +0300
@@ -30,8 +30,6 @@
import java.util.Collections;
import java.util.List;
import java.util.Map;
-import java.util.Optional;
-import java.util.OptionalLong;
import java.util.Set;
import java.util.TreeMap;
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/Log.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/Log.java Thu Nov 09 15:24:39 2017 +0300
@@ -25,7 +25,6 @@
package jdk.incubator.http.internal.common;
-import java.io.IOException;
import jdk.incubator.http.HttpHeaders;
import java.util.ArrayList;
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/Queue.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/Queue.java Thu Nov 09 15:24:39 2017 +0300
@@ -28,7 +28,6 @@
import java.io.IOException;
import java.util.LinkedList;
import java.util.stream.Stream;
-import java.util.Objects;
// Each stream has one of these for input. Each Http2Connection has one
// for output. Can be used blocking or asynchronously.
@@ -46,11 +45,11 @@
return q.size();
}
- public synchronized boolean tryPut(T obj) throws IOException {
- if (closed) return false;
- put(obj);
- return true;
- }
+// public synchronized boolean tryPut(T obj) throws IOException {
+// if (closed) return false;
+// put(obj);
+// return true;
+// }
public synchronized void put(T obj) throws IOException {
if (closed) {
@@ -74,30 +73,30 @@
}
}
- public synchronized void disableCallback() {
- callbackDisabled = true;
- }
+// public synchronized void disableCallback() {
+// callbackDisabled = true;
+// }
- public synchronized void enableCallback() {
- callbackDisabled = false;
- while (q.size() > 0) {
- callback.run();
- }
- }
+// public synchronized void enableCallback() {
+// callbackDisabled = false;
+// while (q.size() > 0) {
+// callback.run();
+// }
+// }
- /**
- * callback is invoked any time put is called where
- * the Queue was empty.
- */
- public synchronized void registerPutCallback(Runnable callback) {
- Objects.requireNonNull(callback);
- this.callback = callback;
- if (q.size() > 0) {
- // Note: calling callback while holding the lock is
- // dangerous and may lead to deadlocks.
- callback.run();
- }
- }
+// /**
+// * callback is invoked any time put is called where
+// * the Queue was empty.
+// */
+// public synchronized void registerPutCallback(Runnable callback) {
+// Objects.requireNonNull(callback);
+// this.callback = callback;
+// if (q.size() > 0) {
+// // Note: calling callback while holding the lock is
+// // dangerous and may lead to deadlocks.
+// callback.run();
+// }
+// }
@Override
public synchronized void close() {
@@ -151,21 +150,21 @@
return res;
}
- public synchronized T[] pollAll(T[] type) throws IOException {
- T[] ret = q.toArray(type);
- q.clear();
- return ret;
- }
+// public synchronized T[] pollAll(T[] type) throws IOException {
+// T[] ret = q.toArray(type);
+// q.clear();
+// return ret;
+// }
- public synchronized void pushback(T v) {
- q.addFirst(v);
- }
+// public synchronized void pushback(T v) {
+// q.addFirst(v);
+// }
- public synchronized void pushbackAll(T[] v) {
- for (int i=v.length-1; i>=0; i--) {
- q.addFirst(v[i]);
- }
- }
+// public synchronized void pushbackAll(T[] v) {
+// for (int i=v.length-1; i>=0; i--) {
+// q.addFirst(v[i]);
+// }
+// }
private IOException newIOException(String msg) {
if (exception == null) {
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/SSLFlowDelegate.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/SSLFlowDelegate.java Thu Nov 09 15:24:39 2017 +0300
@@ -685,7 +685,7 @@
}
}
- // TODO: acknowledge a received CLOSE request from peer
+ // FIXME: acknowledge a received CLOSE request from peer
void doClosure() throws IOException {
//while (!wrapAndSend(emptyArray))
//;
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/SSLTube.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/SSLTube.java Thu Nov 09 15:24:39 2017 +0300
@@ -339,7 +339,7 @@
// onConnection directly.
debug.log(Level.DEBUG,
"SSLSubscriberWrapper (reader) onSubscribeImpl: %s",
- "resusbcribing");
+ "resubscribing");
onNewSubscription(subscriberImpl,
subscriberImpl::onConnection,
subscription);
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/SubscriberWrapper.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/SubscriberWrapper.java Thu Nov 09 15:24:39 2017 +0300
@@ -59,11 +59,11 @@
implements FlowTube.TubeSubscriber, Closeable, Flow.Processor<List<ByteBuffer>,List<ByteBuffer>>
// TODO: SSLTube Subscriber will never change? Does this really need to be a TS?
{
- static final boolean DEBUG = Utils.DEBUG;; // Revisit: temporary dev flag.
+ static final boolean DEBUG = Utils.DEBUG; // Revisit: temporary dev flag.
final System.Logger logger =
Utils.getDebugLogger(this::dbgString, DEBUG);
- public enum SchedulingAction { CONTINUE, RETURN, RESCHEDULE };
+ public enum SchedulingAction { CONTINUE, RETURN, RESCHEDULE }
volatile Flow.Subscription upstreamSubscription;
final SubscriptionBase downstreamSubscription;
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/Utils.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/common/Utils.java Thu Nov 09 15:24:39 2017 +0300
@@ -25,7 +25,6 @@
package jdk.incubator.http.internal.common;
-import jdk.internal.misc.InnocuousThread;
import sun.net.NetProperties;
import sun.net.util.IPAddressUtil;
@@ -40,8 +39,6 @@
import java.lang.System.Logger.Level;
import java.net.InetSocketAddress;
import java.net.NetPermission;
-import java.net.URI;
-import java.net.URLPermission;
import java.nio.ByteBuffer;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
@@ -52,17 +49,9 @@
import java.util.Collections;
import java.util.List;
import java.util.LinkedList;
-import java.util.Map;
-import java.util.Optional;
-import java.util.ResourceBundle;
import java.util.Set;
-import java.util.concurrent.BlockingQueue;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.CompletionException;
-import java.util.concurrent.Executor;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.LinkedBlockingQueue;
import java.util.function.Predicate;
import java.util.function.Supplier;
import jdk.incubator.http.HttpHeaders;
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/frame/ContinuationFrame.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/frame/ContinuationFrame.java Thu Nov 09 15:24:39 2017 +0300
@@ -26,7 +26,6 @@
package jdk.incubator.http.internal.frame;
import jdk.incubator.http.internal.common.ByteBufferReference;
-import jdk.incubator.http.internal.common.Utils;
public class ContinuationFrame extends HeaderFrame {
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/frame/FramesEncoder.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/frame/FramesEncoder.java Thu Nov 09 15:24:39 2017 +0300
@@ -26,7 +26,6 @@
package jdk.incubator.http.internal.frame;
import jdk.incubator.http.internal.common.ByteBufferReference;
-import jdk.incubator.http.internal.common.Utils;
import java.nio.ByteBuffer;
import java.util.ArrayList;
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/frame/HeaderFrame.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/frame/HeaderFrame.java Thu Nov 09 15:24:39 2017 +0300
@@ -28,8 +28,6 @@
import jdk.incubator.http.internal.common.ByteBufferReference;
import jdk.incubator.http.internal.common.Utils;
-import java.nio.ByteBuffer;
-
/**
* Either a HeadersFrame or a ContinuationFrame
*/
@@ -41,9 +39,9 @@
public static final int END_STREAM = 0x1;
public static final int END_HEADERS = 0x4;
- public HeaderFrame(int streamid, int flags, ByteBufferReference headerBlock) {
- this(streamid, flags, new ByteBufferReference[]{headerBlock});
- }
+// public HeaderFrame(int streamid, int flags, ByteBufferReference headerBlock) {
+// this(streamid, flags, new ByteBufferReference[]{headerBlock});
+// }
public HeaderFrame(int streamid, int flags, ByteBufferReference[] headerBlocks) {
super(streamid, flags);
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/frame/HeadersFrame.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/frame/HeadersFrame.java Thu Nov 09 15:24:39 2017 +0300
@@ -26,7 +26,6 @@
package jdk.incubator.http.internal.frame;
import jdk.incubator.http.internal.common.ByteBufferReference;
-import jdk.incubator.http.internal.common.Utils;
public class HeadersFrame extends HeaderFrame {
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/frame/Http2Frame.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/frame/Http2Frame.java Thu Nov 09 15:24:39 2017 +0300
@@ -61,9 +61,9 @@
return (flags & flag) != 0;
}
- public void clearFlag(int flag) {
- flags &= 0xffffffff ^ flag;
- }
+// public void clearFlag(int flag) {
+// flags &= 0xffffffff ^ flag;
+// }
public void streamid(int streamid) {
this.streamid = streamid;
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/frame/PushPromiseFrame.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/frame/PushPromiseFrame.java Thu Nov 09 15:24:39 2017 +0300
@@ -26,7 +26,6 @@
package jdk.incubator.http.internal.frame;
import jdk.incubator.http.internal.common.ByteBufferReference;
-import jdk.incubator.http.internal.common.Utils;
public class PushPromiseFrame extends HeaderFrame {
--- a/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/hpack/HPACK.java Wed Nov 08 22:51:18 2017 +0000
+++ b/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/internal/hpack/HPACK.java Thu Nov 09 15:24:39 2017 +0300
@@ -26,11 +26,9 @@
import jdk.incubator.http.internal.common.Utils;
import jdk.incubator.http.internal.hpack.HPACK.Logger.Level;
-import jdk.internal.vm.annotation.Stable;
import java.security.AccessController;
import java.security.PrivilegedAction;
-import java.util.Arrays;
import java.util.Map;
import java.util.ResourceBundle;
import java.util.function.Supplier;