equal
deleted
inserted
replaced
22 */ |
22 */ |
23 |
23 |
24 /** |
24 /** |
25 * @test |
25 * @test |
26 * @bug 6373555 |
26 * @bug 6373555 |
|
27 * @library /test/lib |
27 * @summary HTTP Server failing to answer client requests |
28 * @summary HTTP Server failing to answer client requests |
28 */ |
29 */ |
29 |
30 |
30 import java.net.*; |
31 import java.net.*; |
31 import java.io.*; |
32 import java.io.*; |
32 import java.util.*; |
33 import java.util.*; |
33 import com.sun.net.httpserver.*; |
34 import com.sun.net.httpserver.*; |
34 import java.util.concurrent.*; |
35 import java.util.concurrent.*; |
|
36 import jdk.test.lib.net.URIBuilder; |
35 |
37 |
36 public class B6373555 { |
38 public class B6373555 { |
37 |
39 |
38 private static int s_received = 0; |
40 private static int s_received = 0; |
39 private static int sent = 0; |
41 private static int sent = 0; |
94 |
96 |
95 public void run() { |
97 public void run() { |
96 try { |
98 try { |
97 Thread.sleep(10); |
99 Thread.sleep(10); |
98 byte[] buf = getBuf(); |
100 byte[] buf = getBuf(); |
99 URL url = new URL("http://127.0.0.1:"+port+"/test"); |
101 URL url = URIBuilder.newBuilder() |
|
102 .scheme("http") |
|
103 .loopback() |
|
104 .port(port) |
|
105 .path("/test") |
|
106 .toURLUnchecked(); |
|
107 System.out.println("URL: " + url); |
100 HttpURLConnection con = (HttpURLConnection)url.openConnection(); |
108 HttpURLConnection con = (HttpURLConnection)url.openConnection(); |
101 con.setDoOutput(true); |
109 con.setDoOutput(true); |
102 con.setDoInput(true); |
110 con.setDoInput(true); |
103 con.setRequestMethod("POST"); |
111 con.setRequestMethod("POST"); |
104 con.setRequestProperty( |
112 con.setRequestProperty( |