提交 d6c0a300 编写于 作者: C chegar

6954525: Testcase failure java/net/Authenticator/B4769350.java

Reviewed-by: michaelm, weijun
上级 345cfa50
......@@ -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
......
......@@ -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();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册