From d6c0a3002434559ceabea814341a3c772534df7b Mon Sep 17 00:00:00 2001 From: chegar Date: Mon, 28 Jun 2010 14:55:25 +0100 Subject: [PATCH] 6954525: Testcase failure java/net/Authenticator/B4769350.java Reviewed-by: michaelm, weijun --- .../classes/sun/net/www/protocol/http/HttpURLConnection.java | 2 +- jdk/test/java/net/Authenticator/B4769350.java | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java index 1421c737d3..713c7d85c2 100644 --- a/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java +++ b/jdk/src/share/classes/sun/net/www/protocol/http/HttpURLConnection.java @@ -2331,7 +2331,7 @@ public class HttpURLConnection extends java.net.HttpURLConnection { * closed the connection to the web server. */ private void disconnectWeb() throws IOException { - if (usingProxy()) { + if (usingProxy() && http.isKeepingAlive()) { responseCode = -1; // clean up, particularly, skip the content part // of a 401 error response diff --git a/jdk/test/java/net/Authenticator/B4769350.java b/jdk/test/java/net/Authenticator/B4769350.java index b51ac7b3b6..b80e1c70e0 100644 --- a/jdk/test/java/net/Authenticator/B4769350.java +++ b/jdk/test/java/net/Authenticator/B4769350.java @@ -54,6 +54,7 @@ public class B4769350 { boolean allowerror; Client (String authority, String path, boolean allowerror) { + super("Thread-" + path); this.authority = authority; this.path = path; this.allowerror = allowerror; @@ -72,7 +73,8 @@ public class B4769350 { error = true; } catch (IOException e) { if (!allowerror) { - System.out.println (e); + System.out.println (Thread.currentThread().getName() + " " + e); + e.printStackTrace(); error = true; } } @@ -94,6 +96,7 @@ public class B4769350 { } void okReply (HttpTransaction req) throws IOException { + req.addResponseHeader ("Connection", "close"); req.setResponseEntityBody ("Hello ."); req.sendResponse (200, "Ok"); req.orderlyClose(); -- GitLab