7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 6189206
27 * @run main/othervm -Dhttp.keepAlive=false CloseOptionHeader
28 * @summary HTTP client should set "Connection: close" header in request when keepalive is disabled
29 */
30
31 import java.net.*;
32 import java.util.*;
33 import java.io.*;
34 import sun.net.www.MessageHeader;
35
36
37 public class CloseOptionHeader implements Runnable {
38 static ServerSocket ss;
39 static boolean hasCloseHeader = false;
40
41 /*
42 * "Our" http server
43 */
44 public void run() {
45 try {
46 Socket s = ss.accept();
|
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /**
25 * @test
26 * @bug 6189206
27 * @modules java.base/sun.net.www
28 * @run main/othervm -Dhttp.keepAlive=false CloseOptionHeader
29 * @summary HTTP client should set "Connection: close" header in request when keepalive is disabled
30 */
31
32 import java.net.*;
33 import java.util.*;
34 import java.io.*;
35 import sun.net.www.MessageHeader;
36
37
38 public class CloseOptionHeader implements Runnable {
39 static ServerSocket ss;
40 static boolean hasCloseHeader = false;
41
42 /*
43 * "Our" http server
44 */
45 public void run() {
46 try {
47 Socket s = ss.accept();
|