--- a/test/jdk/java/net/httpclient/LightWeightHttpServer.java Sun Nov 05 17:05:57 2017 +0000
+++ b/test/jdk/java/net/httpclient/LightWeightHttpServer.java Sun Nov 05 17:32:13 2017 +0000
@@ -80,7 +80,7 @@
ch.setLevel(Level.ALL);
logger.addHandler(ch);
- String root = System.getProperty("test.src") + "/docs";
+ String root = System.getProperty("test.src", ".") + "/docs";
InetSocketAddress addr = new InetSocketAddress(0);
httpServer = HttpServer.create(addr, 0);
if (httpServer instanceof HttpsServer) {
@@ -301,11 +301,12 @@
@Override
public synchronized void handle(HttpExchange he) throws IOException {
- byte[] buf = Util.readAll(he.getRequestBody());
- try {
+ try(InputStream is = he.getRequestBody()) {
+ is.readAllBytes();
bar1.await();
bar2.await();
} catch (InterruptedException | BrokenBarrierException e) {
+ throw new IOException(e);
}
he.sendResponseHeaders(200, -1); // will probably fail
he.close();