diff --git a/make/autoconf/jdk-options.m4 b/make/autoconf/jdk-options.m4 index 1e3640c0a51..12cf9a4bfd0 100644 --- a/make/autoconf/jdk-options.m4 +++ b/make/autoconf/jdk-options.m4 @@ -208,6 +208,17 @@ AC_DEFUN_ONCE([JDKOPT_SETUP_JDK_OPTIONS], fi AC_SUBST(INCLUDE_SA) + # Setup default CDS alignment. On platforms where one build may run on machines with different + # page sizes, the JVM choses a compatible alignment to fit all possible page sizes. This slightly + # increases archive size. + # The only platform having this problem at the moment is Linux on aarch64, which may encounter + # three different page sizes: 4K, 64K, and if run on Mac m1 hardware, 16K. + COMPATIBLE_CDS_ALIGNMENT_DEFAULT=false + if test "x$OPENJDK_TARGET_OS" = "xlinux" && test "x$OPENJDK_TARGET_CPU" = "xaarch64"; then + COMPATIBLE_CDS_ALIGNMENT_DEFAULT=true + fi + AC_SUBST(COMPATIBLE_CDS_ALIGNMENT_DEFAULT) + # Compress jars COMPRESS_JARS=false @@ -582,7 +593,7 @@ AC_DEFUN([JDKOPT_ENABLE_DISABLE_CDS_ARCHIVE], # AC_DEFUN([JDKOPT_ENABLE_DISABLE_COMPATIBLE_CDS_ALIGNMENT], [ - UTIL_ARG_ENABLE(NAME: compatible-cds-alignment, DEFAULT: false, + UTIL_ARG_ENABLE(NAME: compatible-cds-alignment, DEFAULT: $COMPATIBLE_CDS_ALIGNMENT_DEFAULT, RESULT: ENABLE_COMPATIBLE_CDS_ALIGNMENT, DESC: [enable use alternative compatible cds core region alignment], DEFAULT_DESC: [disabled], diff --git a/make/data/cacerts/globalsigne46 b/make/data/cacerts/globalsigne46 new file mode 100644 index 00000000000..50c7dadefdd --- /dev/null +++ b/make/data/cacerts/globalsigne46 @@ -0,0 +1,20 @@ +Owner: CN=GlobalSign Root E46, O=GlobalSign nv-sa, C=BE +Issuer: CN=GlobalSign Root E46, O=GlobalSign nv-sa, C=BE +Serial number: 11d2bbba336ed4bce62468c50d841d98e843 +Valid from: Wed Mar 20 00:00:00 GMT 2019 until: Tue Mar 20 00:00:00 GMT 2046 +Signature algorithm name: SHA384withECDSA +Subject Public Key Algorithm: 384-bit EC (secp384r1) key +Version: 3 +-----BEGIN CERTIFICATE----- +MIICCzCCAZGgAwIBAgISEdK7ujNu1LzmJGjFDYQdmOhDMAoGCCqGSM49BAMDMEYx +CzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRwwGgYDVQQD +ExNHbG9iYWxTaWduIFJvb3QgRTQ2MB4XDTE5MDMyMDAwMDAwMFoXDTQ2MDMyMDAw +MDAwMFowRjELMAkGA1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYtc2Ex +HDAaBgNVBAMTE0dsb2JhbFNpZ24gUm9vdCBFNDYwdjAQBgcqhkjOPQIBBgUrgQQA +IgNiAAScDrHPt+ieUnd1NPqlRqetMhkytAepJ8qUuwzSChDH2omwlwxwEwkBjtjq +R+q+soArzfwoDdusvKSGN+1wCAB16pMLey5SnCNoIwZD7JIvU4Tb+0cUB+hflGdd +yXqBPCCjQjBAMA4GA1UdDwEB/wQEAwIBhjAPBgNVHRMBAf8EBTADAQH/MB0GA1Ud +DgQWBBQxCpCPtsad0kRLgLWi5h+xEk8blTAKBggqhkjOPQQDAwNoADBlAjEA31SQ +7Zvvi5QCkxeCmb6zniz2C5GMn0oUsfZkvLtoURMMA/cVi4RguYv/Uo7njLwcAjA8 ++RHUjE7AwWHCFUyqqx0LMV87HOIAl0Qx5v5zli/altP+CAezNIm8BZ/3Hobui3A= +-----END CERTIFICATE----- diff --git a/make/data/cacerts/globalsignr46 b/make/data/cacerts/globalsignr46 new file mode 100644 index 00000000000..80d7d92d4fb --- /dev/null +++ b/make/data/cacerts/globalsignr46 @@ -0,0 +1,38 @@ +Owner: CN=GlobalSign Root R46, O=GlobalSign nv-sa, C=BE +Issuer: CN=GlobalSign Root R46, O=GlobalSign nv-sa, C=BE +Serial number: 11d2bbb9d723189e405f0a9d2dd0df2567d1 +Valid from: Wed Mar 20 00:00:00 GMT 2019 until: Tue Mar 20 00:00:00 GMT 2046 +Signature algorithm name: SHA384withRSA +Subject Public Key Algorithm: 4096-bit RSA key +Version: 3 +-----BEGIN CERTIFICATE----- +MIIFWjCCA0KgAwIBAgISEdK7udcjGJ5AXwqdLdDfJWfRMA0GCSqGSIb3DQEBDAUA +MEYxCzAJBgNVBAYTAkJFMRkwFwYDVQQKExBHbG9iYWxTaWduIG52LXNhMRwwGgYD +VQQDExNHbG9iYWxTaWduIFJvb3QgUjQ2MB4XDTE5MDMyMDAwMDAwMFoXDTQ2MDMy +MDAwMDAwMFowRjELMAkGA1UEBhMCQkUxGTAXBgNVBAoTEEdsb2JhbFNpZ24gbnYt +c2ExHDAaBgNVBAMTE0dsb2JhbFNpZ24gUm9vdCBSNDYwggIiMA0GCSqGSIb3DQEB +AQUAA4ICDwAwggIKAoICAQCsrHQy6LNl5brtQyYdpokNRbopiLKkHWPd08EsCVeJ +OaFV6Wc0dwxu5FUdUiXSE2te4R2pt32JMl8Nnp8semNgQB+msLZ4j5lUlghYruQG +vGIFAha/r6gjA7aUD7xubMLL1aa7DOn2wQL7Id5m3RerdELv8HQvJfTqa1VbkNud +316HCkD7rRlr+/fKYIje2sGP1q7Vf9Q8g+7XFkyDRTNrJ9CG0Bwta/OrffGFqfUo +0q3v84RLHIf8E6M6cqJaESvWJ3En7YEtbWaBkoe0G1h6zD8K+kZPTXhc+CtI4wSE +y132tGqzZfxCnlEmIyDLPRT5ge1lFgBPGmSXZgjPjHvjK8Cd+RTyG/FWaha/LIWF +zXg4mutCagI0GIMXTpRW+LaCtfOW3T3zvn8gdz57GSNrLNRyc0NXfeD412lPFzYE ++cCQYDdF3uYM2HSNrpyibXRdQr4G9dlkbgIQrImwTDsHTUB+JMWKmIJ5jqSngiCN +I/onccnfxkF0oE32kRbcRoxfKWMxWXEM2G/CtjJ9++ZdU6Z+Ffy7dXxd7Pj2Fxzs +x2sZy/N78CsHpdlseVR2bJ0cpm4O6XkMqCNqo98bMDGfsVR7/mrLZqrcZdCinkqa +ByFrgY/bxFn63iLABJzjqls2k+g9vXqhnQt2sQvHnf3PmKgGwvgqo6GDoLclcqUC +4wIDAQABo0IwQDAOBgNVHQ8BAf8EBAMCAYYwDwYDVR0TAQH/BAUwAwEB/zAdBgNV +HQ4EFgQUA1yrc4GHqMywptWU4jaWSf8FmSwwDQYJKoZIhvcNAQEMBQADggIBAHx4 +7PYCLLtbfpIrXTncvtgdokIzTfnvpCo7RGkerNlFo048p9gkUbJUHJNOxO97k4Vg +JuoJSOD1u8fpaNK7ajFxzHmuEajwmf3lH7wvqMxX63bEIaZHU1VNaL8FpO7XJqti +2kM3S+LGteWygxk6x9PbTZ4IevPuzz5i+6zoYMzRx6Fcg0XERczzF2sUyQQCPtIk +pnnpHs6i58FZFZ8d4kuaPp92CC1r2LpXFNqD6v6MVenQTqnMdzGxRBF6XLE+0xRF +FRhiJBPSy03OXIPBNvIQtQ6IbbjhVp+J3pZmOUdkLG5NrmJ7v2B0GbhWrJKsFjLt +rWhV/pi60zTe9Mlhww6G9kuEYO4Ne7UyWHmRVSyBQ7N0H3qqJZ4d16GLuc1CLgSk +ZoNNiTW2bKg2SnkheCLQQrzRQDGQob4Ez8pn7fXwgNNgyYMqIgXQBztSvwyeqiv5 +u+YfjyW6hY0XHgL+XVAEV8/+LbzvXMAaq7afJMbfc2hIkCwU9D9SGuTSyxTDYWnP +4vkYxboznxSjBF25cfe1lNj2M8FawTSLfJvdkzrnE6JwYZ+vj+vYxXX4M2bUdGc6 +N3ec592kD3ZDZopD8p/7DEJ4Y9HiD2971KE9dJeFt0g5QdYg/NA6s/rob8SKunE3 +vouXsXgxT7PntgMTzlSdriVZzH81Xwj3QEUxeCp6 +-----END CERTIFICATE----- diff --git a/make/modules/java.desktop/lib/Awt2dLibraries.gmk b/make/modules/java.desktop/lib/Awt2dLibraries.gmk index 3bbff03638b..46e3b1677f7 100644 --- a/make/modules/java.desktop/lib/Awt2dLibraries.gmk +++ b/make/modules/java.desktop/lib/Awt2dLibraries.gmk @@ -467,9 +467,12 @@ else array-bounds parentheses # noexcept-type required for GCC 7 builds. Not required for GCC 8+. # expansion-to-defined required for GCC 9 builds. Not required for GCC 10+. + # maybe-uninitialized required for GCC 8 builds. Not required for GCC 9+. + # calloc-transposed-args required for GCC 14 builds. (fixed upstream in Harfbuzz 032c931e1c0cfb20f18e5acb8ba005775242bd92) HARFBUZZ_DISABLED_WARNINGS_CXX_gcc := reorder delete-non-virtual-dtor strict-overflow \ maybe-uninitialized class-memaccess unused-result extra use-after-free noexcept-type \ - expansion-to-defined dangling-reference + expansion-to-defined dangling-reference maybe-uninitialized \ + calloc-transposed-args HARFBUZZ_DISABLED_WARNINGS_clang := unused-value incompatible-pointer-types \ tautological-constant-out-of-range-compare int-to-pointer-cast \ undef missing-field-initializers range-loop-analysis \ diff --git a/src/java.base/share/classes/sun/net/www/http/KeepAliveCache.java b/src/java.base/share/classes/sun/net/www/http/KeepAliveCache.java index 5bdd6f2c009..2abb5667b97 100644 --- a/src/java.base/share/classes/sun/net/www/http/KeepAliveCache.java +++ b/src/java.base/share/classes/sun/net/www/http/KeepAliveCache.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1996, 2021, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1996, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -407,9 +407,9 @@ public KeepAliveKey(URL url, Object obj) { */ @Override public boolean equals(Object obj) { - if ((obj instanceof KeepAliveKey) == false) + if (!(obj instanceof KeepAliveKey kae)) return false; - KeepAliveKey kae = (KeepAliveKey)obj; + return host.equals(kae.host) && (port == kae.port) && protocol.equals(kae.protocol) @@ -423,7 +423,7 @@ public boolean equals(Object obj) { @Override public int hashCode() { String str = protocol+host+port; - return this.obj == null? str.hashCode() : + return this.obj == null ? str.hashCode() : str.hashCode() + this.obj.hashCode(); } } diff --git a/src/java.desktop/linux/native/libjsound/PLATFORM_API_LinuxOS_ALSA_MidiIn.c b/src/java.desktop/linux/native/libjsound/PLATFORM_API_LinuxOS_ALSA_MidiIn.c index 82f564119ba..adfb2e3e90c 100644 --- a/src/java.desktop/linux/native/libjsound/PLATFORM_API_LinuxOS_ALSA_MidiIn.c +++ b/src/java.desktop/linux/native/libjsound/PLATFORM_API_LinuxOS_ALSA_MidiIn.c @@ -218,7 +218,7 @@ MidiMessage* MIDI_IN_GetMessage(MidiDeviceHandle* handle) { return NULL; } } - jdk_message = (MidiMessage*) calloc(sizeof(MidiMessage), 1); + jdk_message = (MidiMessage*) calloc(1, sizeof(MidiMessage)); if (!jdk_message) { ERROR0("< ERROR: MIDI_IN_GetMessage(): out of memory\n"); return NULL; diff --git a/src/java.desktop/linux/native/libjsound/PLATFORM_API_LinuxOS_ALSA_MidiUtils.c b/src/java.desktop/linux/native/libjsound/PLATFORM_API_LinuxOS_ALSA_MidiUtils.c index 14475413f1c..3f482c824ad 100644 --- a/src/java.desktop/linux/native/libjsound/PLATFORM_API_LinuxOS_ALSA_MidiUtils.c +++ b/src/java.desktop/linux/native/libjsound/PLATFORM_API_LinuxOS_ALSA_MidiUtils.c @@ -383,7 +383,7 @@ INT32 openMidiDevice(snd_rawmidi_stream_t direction, INT32 deviceIndex, TRACE0("> openMidiDevice()\n"); - (*handle) = (MidiDeviceHandle*) calloc(sizeof(MidiDeviceHandle), 1); + (*handle) = (MidiDeviceHandle*) calloc(1, sizeof(MidiDeviceHandle)); if (!(*handle)) { ERROR0("ERROR: openDevice: out of memory\n"); return MIDI_OUT_OF_MEMORY; diff --git a/src/java.desktop/share/native/libfontmanager/sunFont.c b/src/java.desktop/share/native/libfontmanager/sunFont.c index 661dccae0c5..4704f18ea4a 100644 --- a/src/java.desktop/share/native/libfontmanager/sunFont.c +++ b/src/java.desktop/share/native/libfontmanager/sunFont.c @@ -67,7 +67,7 @@ int isNullScalerContext(void *context) { */ JNIEXPORT jlong JNICALL Java_sun_font_NullFontScaler_getGlyphImage (JNIEnv *env, jobject scaler, jlong pContext, jint glyphCode) { - void *nullscaler = calloc(sizeof(GlyphInfo), 1); + void *nullscaler = calloc(1, sizeof(GlyphInfo)); return ptr_to_jlong(nullscaler); } diff --git a/test/hotspot/jtreg/gc/g1/plab/TestPLABPromotion.java b/test/hotspot/jtreg/gc/g1/plab/TestPLABPromotion.java index add5f3ec16f..0a9bd24b5f5 100644 --- a/test/hotspot/jtreg/gc/g1/plab/TestPLABPromotion.java +++ b/test/hotspot/jtreg/gc/g1/plab/TestPLABPromotion.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ * @bug 8141278 8141141 * @summary Test PLAB promotion * @requires vm.gc.G1 - * @requires !vm.flightRecorder + * @requires vm.flagless * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.management diff --git a/test/hotspot/jtreg/gc/g1/plab/TestPLABResize.java b/test/hotspot/jtreg/gc/g1/plab/TestPLABResize.java index 0c9ebb12e82..245326ec0bf 100644 --- a/test/hotspot/jtreg/gc/g1/plab/TestPLABResize.java +++ b/test/hotspot/jtreg/gc/g1/plab/TestPLABResize.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2016, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -26,7 +26,7 @@ * @bug 8141278 8141141 * @summary Test for PLAB resizing * @requires vm.gc.G1 - * @requires !vm.flightRecorder + * @requires vm.flagless * @library /test/lib / * @modules java.base/jdk.internal.misc * @modules java.management diff --git a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java index 0b832366286..9f071bc1450 100644 --- a/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java +++ b/test/jdk/security/infra/java/security/cert/CertPathValidator/certification/CAInterop.java @@ -511,6 +511,28 @@ * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop certainlyroote1 DEFAULT */ +/* + * @test id=globalsignr46 + * @bug 8316138 + * @summary Interoperability tests with GlobalSign Root R46 + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop globalsignr46 OCSP + * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop globalsignr46 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop globalsignr46 CRL + */ + +/* + * @test id=globalsigne46 + * @bug 8316138 + * @summary Interoperability tests with GlobalSign Root E46 + * @library /test/lib + * @build jtreg.SkippedException ValidatePathWithURL CAInterop + * @run main/othervm -Djava.security.debug=certpath,ocsp CAInterop globalsigne46 OCSP + * @run main/othervm -Djava.security.debug=certpath,ocsp -Dcom.sun.security.ocsp.useget=false CAInterop globalsigne46 OCSP + * @run main/othervm -Djava.security.debug=certpath CAInterop globalsigne46 CRL + */ + /** * Collection of certificate validation tests for interoperability with external CAs */ @@ -680,6 +702,13 @@ private CATestURLs getTestURLs(String alias) { new CATestURLs("https://valid.root-e1.certainly.com", "https://revoked.root-e1.certainly.com"); + case "globalsignr46" -> + new CATestURLs("https://valid.r46.roots.globalsign.com", + "https://revoked.r46.roots.globalsign.com"); + case "globalsigne46" -> + new CATestURLs("https://valid.e46.roots.globalsign.com", + "https://revoked.e46.roots.globalsign.com"); + default -> throw new RuntimeException("No test setup found for: " + alias); }; } diff --git a/test/jdk/sun/net/www/http/HttpClient/KeepAliveTest.java b/test/jdk/sun/net/www/http/HttpClient/KeepAliveTest.java index 15983f3196a..0fdfb591a8c 100644 --- a/test/jdk/sun/net/www/http/HttpClient/KeepAliveTest.java +++ b/test/jdk/sun/net/www/http/HttpClient/KeepAliveTest.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2022 Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2022, 2024, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -24,177 +24,29 @@ /* * @test * @library /test/lib - * @bug 8291226 8291638 - * @modules java.base/sun.net:+open - * java.base/sun.net.www.http:+open - * java.base/sun.net.www:+open + * @bug 8291226 8291638 8330523 + * @modules java.base/sun.net.www.http:+open * java.base/sun.net.www.protocol.http:+open - * @run main/othervm KeepAliveTest 0 - * @run main/othervm KeepAliveTest 1 - * @run main/othervm KeepAliveTest 2 - * @run main/othervm KeepAliveTest 3 - * @run main/othervm KeepAliveTest 4 - * @run main/othervm KeepAliveTest 5 - * @run main/othervm KeepAliveTest 6 - * @run main/othervm KeepAliveTest 7 - * @run main/othervm KeepAliveTest 8 - * @run main/othervm KeepAliveTest 9 - * @run main/othervm KeepAliveTest 10 - * @run main/othervm KeepAliveTest 11 - * @run main/othervm KeepAliveTest 12 - * @run main/othervm KeepAliveTest 13 - * @run main/othervm KeepAliveTest 14 - * @run main/othervm KeepAliveTest 15 - * @run main/othervm KeepAliveTest 16 - * @run main/othervm KeepAliveTest 17 - * @run main/othervm KeepAliveTest 18 - * @run main/othervm KeepAliveTest 19 - * @run main/othervm KeepAliveTest 20 - * @run main/othervm KeepAliveTest 21 - * @run main/othervm KeepAliveTest 22 - * @run main/othervm KeepAliveTest 23 - * @run main/othervm KeepAliveTest 24 - * @run main/othervm KeepAliveTest 25 - * @run main/othervm KeepAliveTest 26 - * @run main/othervm KeepAliveTest 27 - * @run main/othervm KeepAliveTest 28 - * @run main/othervm KeepAliveTest 29 - * @run main/othervm KeepAliveTest 30 - * @run main/othervm KeepAliveTest 31 - * @run main/othervm KeepAliveTest 32 - * @run main/othervm KeepAliveTest 33 - * @run main/othervm KeepAliveTest 34 - * @run main/othervm KeepAliveTest 35 - * @run main/othervm KeepAliveTest 36 - * @run main/othervm KeepAliveTest 37 - * @run main/othervm KeepAliveTest 38 - * @run main/othervm KeepAliveTest 39 - * @run main/othervm KeepAliveTest 40 - * @run main/othervm KeepAliveTest 41 - * @run main/othervm KeepAliveTest 42 - * @run main/othervm KeepAliveTest 43 - * @run main/othervm KeepAliveTest 44 - * @run main/othervm KeepAliveTest 45 - * @run main/othervm KeepAliveTest 46 - * @run main/othervm KeepAliveTest 47 - * @run main/othervm KeepAliveTest 48 - * @run main/othervm KeepAliveTest 49 - * @run main/othervm KeepAliveTest 50 - * @run main/othervm KeepAliveTest 51 - * @run main/othervm KeepAliveTest 52 - * @run main/othervm KeepAliveTest 53 - * @run main/othervm KeepAliveTest 54 - * @run main/othervm KeepAliveTest 55 - * @run main/othervm KeepAliveTest 56 - * @run main/othervm KeepAliveTest 57 - * @run main/othervm KeepAliveTest 58 - * @run main/othervm KeepAliveTest 59 - * @run main/othervm KeepAliveTest 60 - * @run main/othervm KeepAliveTest 61 - * @run main/othervm KeepAliveTest 62 - * @run main/othervm KeepAliveTest 63 - * @run main/othervm KeepAliveTest 64 - * @run main/othervm KeepAliveTest 65 - * @run main/othervm KeepAliveTest 66 - * @run main/othervm KeepAliveTest 67 - * @run main/othervm KeepAliveTest 68 - * @run main/othervm KeepAliveTest 69 - * @run main/othervm KeepAliveTest 70 - * @run main/othervm KeepAliveTest 71 - * @run main/othervm KeepAliveTest 72 - * @run main/othervm KeepAliveTest 73 - * @run main/othervm KeepAliveTest 74 - * @run main/othervm KeepAliveTest 75 - * @run main/othervm KeepAliveTest 76 - * @run main/othervm KeepAliveTest 77 - * @run main/othervm KeepAliveTest 78 - * @run main/othervm KeepAliveTest 79 - * @run main/othervm KeepAliveTest 80 - * @run main/othervm KeepAliveTest 81 - * @run main/othervm KeepAliveTest 82 - * @run main/othervm KeepAliveTest 83 - * @run main/othervm KeepAliveTest 84 - * @run main/othervm KeepAliveTest 85 - * @run main/othervm KeepAliveTest 86 - * @run main/othervm KeepAliveTest 87 - * @run main/othervm KeepAliveTest 88 - * @run main/othervm KeepAliveTest 89 - * @run main/othervm KeepAliveTest 90 - * @run main/othervm KeepAliveTest 91 - * @run main/othervm KeepAliveTest 92 - * @run main/othervm KeepAliveTest 93 - * @run main/othervm KeepAliveTest 94 - * @run main/othervm KeepAliveTest 95 - * @run main/othervm KeepAliveTest 96 - * @run main/othervm KeepAliveTest 97 - * @run main/othervm KeepAliveTest 98 - * @run main/othervm KeepAliveTest 99 - * @run main/othervm KeepAliveTest 100 - * @run main/othervm KeepAliveTest 101 - * @run main/othervm KeepAliveTest 102 - * @run main/othervm KeepAliveTest 103 - * @run main/othervm KeepAliveTest 104 - * @run main/othervm KeepAliveTest 105 - * @run main/othervm KeepAliveTest 106 - * @run main/othervm KeepAliveTest 107 - * @run main/othervm KeepAliveTest 108 - * @run main/othervm KeepAliveTest 109 - * @run main/othervm KeepAliveTest 110 - * @run main/othervm KeepAliveTest 111 - * @run main/othervm KeepAliveTest 112 - * @run main/othervm KeepAliveTest 113 - * @run main/othervm KeepAliveTest 114 - * @run main/othervm KeepAliveTest 115 - * @run main/othervm KeepAliveTest 116 - * @run main/othervm KeepAliveTest 117 - * @run main/othervm KeepAliveTest 118 - * @run main/othervm KeepAliveTest 119 - * @run main/othervm KeepAliveTest 120 - * @run main/othervm KeepAliveTest 121 - * @run main/othervm KeepAliveTest 122 - * @run main/othervm KeepAliveTest 123 - * @run main/othervm KeepAliveTest 124 - * @run main/othervm KeepAliveTest 125 - * @run main/othervm KeepAliveTest 126 - * @run main/othervm KeepAliveTest 127 - * @run main/othervm KeepAliveTest 128 - * @run main/othervm KeepAliveTest 129 - * @run main/othervm KeepAliveTest 130 - * @run main/othervm KeepAliveTest 131 - * @run main/othervm KeepAliveTest 132 - * @run main/othervm KeepAliveTest 133 - * @run main/othervm KeepAliveTest 134 - * @run main/othervm KeepAliveTest 135 - * @run main/othervm KeepAliveTest 136 - * @run main/othervm KeepAliveTest 137 - * @run main/othervm KeepAliveTest 138 - * @run main/othervm KeepAliveTest 139 - * @run main/othervm KeepAliveTest 140 - * @run main/othervm KeepAliveTest 141 - * @run main/othervm KeepAliveTest 142 - * @run main/othervm KeepAliveTest 143 - * @run main/othervm KeepAliveTest 144 - * @run main/othervm KeepAliveTest 145 - * @run main/othervm KeepAliveTest 146 - * @run main/othervm KeepAliveTest 147 - * @run main/othervm KeepAliveTest 148 - * @run main/othervm KeepAliveTest 149 - * @run main/othervm KeepAliveTest 150 - * @run main/othervm KeepAliveTest 151 - * @run main/othervm KeepAliveTest 152 - * @run main/othervm KeepAliveTest 153 - * @run main/othervm KeepAliveTest 154 - * @run main/othervm KeepAliveTest 155 - * @run main/othervm KeepAliveTest 156 - * @run main/othervm KeepAliveTest 157 - * @run main/othervm KeepAliveTest 158 - * @run main/othervm KeepAliveTest 159 + * @run main/othervm KeepAliveTest + * @run main/othervm -Dhttp.keepAlive.time.server=100 KeepAliveTest + * @run main/othervm -Dhttp.keepAlive.time.proxy=200 KeepAliveTest + * @run main/othervm -Dhttp.keepAlive.time.server=100 -Dhttp.keepAlive.time.proxy=200 KeepAliveTest + * @run main/othervm -Dhttp.keepAlive.time.server=-100 KeepAliveTest + * @run main/othervm -Dhttp.keepAlive.time.proxy=-200 KeepAliveTest + * @run main/othervm -Dhttp.keepAlive.time.server=-100 -Dhttp.keepAlive.time.proxy=-200 KeepAliveTest + * @run main/othervm -Dhttp.keepAlive.time.server=0 KeepAliveTest + * @run main/othervm -Dhttp.keepAlive.time.proxy=0 KeepAliveTest + * @run main/othervm -Dhttp.keepAlive.time.server=0 -Dhttp.keepAlive.time.proxy=0 KeepAliveTest + * @run main/othervm -Dhttp.keepAlive.time.server=0 -Dhttp.keepAlive.time.proxy=-200 KeepAliveTest + * @run main/othervm -Dhttp.keepAlive.time.server=-100 -Dhttp.keepAlive.time.proxy=0 KeepAliveTest + * @run main/othervm -Dhttp.keepAlive.time.server=100 -Dhttp.keepAlive.time.proxy=0 KeepAliveTest + * @run main/othervm -Dhttp.keepAlive.time.server=0 -Dhttp.keepAlive.time.proxy=200 KeepAliveTest + * @run main/othervm -Dhttp.keepAlive.time.server=100 -Dhttp.keepAlive.time.proxy=-200 KeepAliveTest + * @run main/othervm -Dhttp.keepAlive.time.server=-100 -Dhttp.keepAlive.time.proxy=200 KeepAliveTest */ - -import java.nio.charset.StandardCharsets; -import java.io.InputStream; import java.io.BufferedReader; import java.io.IOException; +import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.lang.reflect.Constructor; @@ -206,841 +58,59 @@ import java.net.ServerSocket; import java.net.Socket; import java.net.URL; +import java.nio.charset.StandardCharsets; import java.util.List; import java.util.Map.Entry; -import java.util.concurrent.CountDownLatch; +import java.util.concurrent.Phaser; import java.util.logging.ConsoleHandler; import java.util.logging.Level; import java.util.logging.Logger; + +import jdk.test.lib.net.URIBuilder; + import sun.net.www.http.HttpClient; import sun.net.www.http.KeepAliveCache; import sun.net.www.protocol.http.HttpURLConnection; -import jdk.test.lib.net.URIBuilder; public class KeepAliveTest { - private static final Logger logger = Logger.getLogger("sun.net.www.protocol.http.HttpURLConnection"); - private static final String NOT_CACHED = "NotCached"; - private static final String CLIENT_SEPARATOR = ";"; - private static final String NEW_LINE = "\r\n"; - private volatile int SERVER_PORT = 0; + /* - * isProxySet is shared variable between server thread and client thread(main) and it should be set and reset to false for each and - * every scenario. - * isProxySet variable should be set by server thread before proceeding to client thread(main). + * This test covers a matrix of 10 server scenarios and 16 client scenarios. */ - private volatile boolean isProxySet = false; + private static final Logger logger = Logger.getLogger("sun.net.www.protocol.http.HttpURLConnection"); + + private static final String NEW_LINE = "\r\n"; + private static final String CONNECTION_KEEP_ALIVE_ONLY = "Connection: keep-alive"; private static final String PROXY_CONNECTION_KEEP_ALIVE_ONLY = "Proxy-Connection: keep-alive"; private static final String KEEP_ALIVE_TIMEOUT_NEG = "Keep-alive: timeout=-20"; private static final String KEEP_ALIVE_TIMEOUT_ZERO = "Keep-alive: timeout=0"; private static final String KEEP_ALIVE_TIMEOUT = "Keep-alive: timeout=20"; private static final String KEEP_ALIVE_PROXY_TIMEOUT = "Keep-alive: timeout=120"; - private static final String CLIENT_HTTP_KEEP_ALIVE_TIME_SERVER_NEGATIVE = "http.keepAlive.time.server=-100"; - private static final String CLIENT_HTTP_KEEP_ALIVE_TIME_PROXY_NEGATIVE = "http.keepAlive.time.proxy=-200"; - private static final String CLIENT_HTTP_KEEP_ALIVE_TIME_SERVER_ZERO = "http.keepAlive.time.server=0"; - private static final String CLIENT_HTTP_KEEP_ALIVE_TIME_PROXY_ZERO = "http.keepAlive.time.proxy=0"; - private static final String CLIENT_HTTP_KEEP_ALIVE_TIME_SERVER_POSITIVE = "http.keepAlive.time.server=100"; - private static final String CLIENT_HTTP_KEEP_ALIVE_TIME_PROXY_POSITIVE = "http.keepAlive.time.proxy=200"; - private static final String CONNECTION_KEEP_ALIVE_WITH_TIMEOUT = CONNECTION_KEEP_ALIVE_ONLY + NEW_LINE - + KEEP_ALIVE_TIMEOUT; - /* - * Following Constants represents Client Side Properties and is used as reference in below table as - * CLIENT_INPUT_CONSTANT_NAMES - */ - private static final String SERVER_100_NEGATIVE = CLIENT_HTTP_KEEP_ALIVE_TIME_SERVER_NEGATIVE; - private static final String PROXY_200_NEGATIVE = CLIENT_HTTP_KEEP_ALIVE_TIME_PROXY_NEGATIVE; - private static final String SERVER_ZERO = CLIENT_HTTP_KEEP_ALIVE_TIME_SERVER_ZERO; - private static final String PROXY_ZERO = CLIENT_HTTP_KEEP_ALIVE_TIME_PROXY_ZERO; - private static final String SERVER_100 = CLIENT_HTTP_KEEP_ALIVE_TIME_SERVER_POSITIVE; - private static final String PROXY_200 = CLIENT_HTTP_KEEP_ALIVE_TIME_PROXY_POSITIVE; - - /* - * CONSTANTS A,B,C,D,E,NI,F,G,H,I represents ServerScenarios and is used as reference in below table - * as SERVER_RESPONSE_CONSTANT_NAME - */ - private static final String A = CONNECTION_KEEP_ALIVE_ONLY; - private static final String B = CONNECTION_KEEP_ALIVE_WITH_TIMEOUT; - private static final String C = PROXY_CONNECTION_KEEP_ALIVE_ONLY; - private static final String D = PROXY_CONNECTION_KEEP_ALIVE_ONLY + NEW_LINE + CONNECTION_KEEP_ALIVE_ONLY; - private static final String E = C + NEW_LINE + KEEP_ALIVE_PROXY_TIMEOUT; - private static final String NI = "NO_INPUT"; - private static final String F = A + NEW_LINE + KEEP_ALIVE_TIMEOUT_NEG; - private static final String G = A + NEW_LINE + KEEP_ALIVE_TIMEOUT_ZERO; - private static final String H = C + NEW_LINE + KEEP_ALIVE_TIMEOUT_NEG; - private static final String I = C + NEW_LINE + KEEP_ALIVE_TIMEOUT_ZERO; - - /* - * There are 160 scenarios run by this program. - * For every scenario there is mapping between serverScenarios[int],clientScenarios[int] and expectedOutput[int] - * - * serverScenarios[0] clientScenarios[0] expectedOutput[0] - * serverScenarios[1] clientScenarios[1] expectedOutput[1] - * serverScenarios[2] clientScenarios[2] expectedOutput[2] - * - * ... - * - * serverScenarios[159] cientScenarios[159] expectedOutput[159] - * - * whereas serverScenarios[int] is retrieved using getServerScenario(int) - * whereas clientScenarios[int] is retrieved using clientScenario[getClientScenarioNumber[int]] - * and - * expectedOutput[int] is retrieved using expectedOuput[int] directly. - * - */ - - /* Here is the complete table of server_response, client system properties input and expected cached timeout at client side */ - /* ScNo | SERVER RESPONSE (SERVER_RESPONSE_CONSTANT_NAME)| CLIENT SYSTEM PROPERTIES INPUT (CLIENT_INPUT_CONSTANT_NAMES) | EXPECTED CACHED TIMEOUT AT CLIENT SIDE - ***************************************************************************************************************************************** - * 0 | Connection: keep-alive (A) | No Input Provided (NI) | Default Timeout set to 5 - *--------------------------------------------------------------------------------------------------------------------------- - * 1 | Connection: keep-alive (A) | -Dhttp.keepAlive.time.server=100 (SERVER_100)| Client Timeout set to 100 - *-------------------------------------------------------------------------------------------------------------------------- - * 2 | Connection: keep-alive (A) | -Dhttp.keepAlive.time.proxy=200 (PROXY_200) | Default Timeout set to 5 - *--------------------------------------------------------------------------------------------------------------------------- - * 3 | Connection: keep-alive (A) | -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=200 | Timeout set to 100 - * | | (SERVER_100 && PROXY_200) | - *--------------------------------------------------------------------------------------------------------------------------- - * 4 | Connection: keep-alive (A) | -Dhttp.keepAlive.time.server=-100 | Default Timeout set to 5 - * | | (SERVER_100_NEGATIVE) | - *--------------------------------------------------------------------------------------------------------------------------- - * 5 | Connection: keep-alive (A) | -Dhttp.keepAlive.time.proxy=-200 | Default Timeout set to 5 - * | | (PROXY_200_NEGATIVE) | - *--------------------------------------------------------------------------------------------------------------------------- - * 6 | Connection: keep-alive (A) | -Dhttp.keepAlive.time.server=-100 && | - * | | -Dhttp.keepAlive.time.proxy=-200 | Default Timeout set to 5 - * | | (SERVER_100_NEGATIVE && PROXY_200_NEGATIVE) | - *--------------------------------------------------------------------------------------------------------------------------- - * 7 | Connection: keep-alive (A) | -Dhttp.keepAlive.time.server=0 | Connection Closed Immediately - * | | (SERVER_ZERO) | - *--------------------------------------------------------------------------------------------------------------------------- - * 8 | Connection: keep-alive (A) | -Dhttp.keepAlive.time.proxy=0 | Default Timeout set to 5 - * | | (PROXY_ZERO) | - *--------------------------------------------------------------------------------------------------------------------------- - * 9 | Connection: keep-alive (A) | -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=0 | Connection Closed Immediately - * | | (SERVER_ZERO && PROXY_ZERO) | - *--------------------------------------------------------------------------------------------------------------------------- - * 10 | Connection: keep-alive (A) | -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=-200 | Connection Closed Immediately - * | | (SERVER_ZERO && PROXY_200_NEGATIVE) | - *--------------------------------------------------------------------------------------------------------------------------- - * 11 | Connection: keep-alive (A) | -Dhttp.keepAlive.time.server=-100 && | - * | | -Dhttp.keepAlive.time.proxy=0 | Default Timeout set to 5 - * | | (SERVER_100_NEGATIVE && PROXY_ZERO) | - *--------------------------------------------------------------------------------------------------------------------------- - * 12 | Connection: keep-alive (A) | -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=0 | Timeout set to 100 - * | | (SERVER_100 && PROXY_ZERO) | - *--------------------------------------------------------------------------------------------------------------------------- - * 13 | Connection: keep-alive (A) | -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=200 | Connection Closed Immediately - * | | (SERVER_ZERO && PROXY_200) | - *--------------------------------------------------------------------------------------------------------------------------- - * 14 | Connection: keep-alive (A) | -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=-200 | Timeout set to 100 - * | | (SERVER_100 && PROXY_200_NEGATIVE) | - *--------------------------------------------------------------------------------------------------------------------------- - * 15 | Connection: keep-alive (A) | -Dhttp.keepAlive.time.server=-100 && | - * | | -Dhttp.keepAlive.time.proxy=200 | Default Timeout set to 5 - * | | (SERVER_100_NEGATIVE && PROXY_200) | - *--------------------------------------------------------------------------------------------------------------------------- - * 16 |Connection: keep-alive\r\nKeep-alive: timeout=20 (B) | No Input Provided (NI) | Timeout set to 20 - *------------------------------------------------------------------------------------------------------------------------ - * 17 |Connection: keep-alive\r\nKeep-alive: timeout=20 (B) | -Dhttp.keepAlive.time.server=100 | Timeout set to 20 - * | | (SERVER_100) | - *--------------------------------------------------------------------------------------------------------------------------- - * 18 |Connection: keep-alive\r\nKeep-alive: timeout=20 (B) | -Dhttp.keepAlive.time.proxy=200 | Timeout set to 20 - * | | (PROXY_200) | - *--------------------------------------------------------------------------------------------------------------------------- - * 19 |Connection: keep-alive\r\nKeep-alive: timeout=20 (B) | -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=200 | Timeout set to 20 - * | | (SERVER_100 && PROXY_200) | - *--------------------------------------------------------------------------------------------------------------------------- - * 20 |Connection: keep-alive\r\nKeep-alive: timeout=20 (B) | -Dhttp.keepAlive.time.server=-100 | Timeout set to 20 - * | | (SERVER_100_NEGATIVE) | - *--------------------------------------------------------------------------------------------------------------------------- - * 21 |Connection: keep-alive\r\nKeep-alive: timeout=20 (B) | -Dhttp.keepAlive.time.proxy=-200 | Timeout set to 20 - * | | (PROXY_200_NEGATIVE) | - *--------------------------------------------------------------------------------------------------------------------------- - * 22 |Connection: keep-alive\r\nKeep-alive: timeout=20 (B) | -Dhttp.keepAlive.time.server=-100 && | - * | | -Dhttp.keepAlive.time.proxy=-200 | Timeout set to 20 - * | | (SERVER_100_NEGATIVE && PROXY_200_NEGATIVE)| - *--------------------------------------------------------------------------------------------------------------------------- - * 23 |Connection: keep-alive\r\nKeep-alive: timeout=20 (B) | -Dhttp.keepAlive.time.server=0 | Timeout set to 20 - * | | (SERVER_ZERO) | - *--------------------------------------------------------------------------------------------------------------------------- - * 24 |Connection: keep-alive\r\nKeep-alive: timeout=20 (B) | -Dhttp.keepAlive.time.proxy=0 | Timeout set to 20 - * | | (PROXY_ZERO) | - *--------------------------------------------------------------------------------------------------------------------------- - * 25 |Connection: keep-alive\r\nKeep-alive: timeout=20 (B) | -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=0 | Timeout set to 20 - * | | (SERVER_ZERO && PROXY_ZERO) | - *--------------------------------------------------------------------------------------------------------------------------- - * 26 |Connection: keep-alive\r\nKeep-alive: timeout=20 (B) | -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=-200 | Timeout set to 20 - * | | (SERVER_ZERO && PROXY_200_NEGATIVE) | - *--------------------------------------------------------------------------------------------------------------------------- - * 27 |Connection: keep-alive\r\nKeep-alive: timeout=20 (B) | -Dhttp.keepAlive.time.server=-100 &&| - * | | -Dhttp.keepAlive.time.proxy=0 | Timeout set to 20 - * | | (SERVER_100_NEGATIVE && PROXY_ZERO) | - *--------------------------------------------------------------------------------------------------------------------------- - * 28 |Connection: keep-alive\r\nKeep-alive: timeout=20 (B) | -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=0 | Timeout set to 20 - * | | (SERVER_100 && PROXY_ZERO) | - *--------------------------------------------------------------------------------------------------------------------------- - * 29 |Connection: keep-alive\r\nKeep-alive: timeout=20 (B) | -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=200 | Timeout set to 20 - * | | (SERVER_ZERO && PROXY_200) | - *--------------------------------------------------------------------------------------------------------------------------- - * 30 |Connection: keep-alive\r\nKeep-alive: timeout=20 (B) | -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=-200 | Timeout set to 20 - * | | (SERVER_100 && PROXY_200_NEGATIVE) | - *--------------------------------------------------------------------------------------------------------------------------- - * 31 |Connection: keep-alive\r\nKeep-alive: timeout=20 (B) |-Dhttp.keepAlive.time.server=-100 && | - * | |-Dhttp.keepAlive.time.proxy=200 | Timeout set to 20 - * | | (SERVER_100_NEGATIVE && PROXY_200) | - *--------------------------------------------------------------------------------------------------------------------------- - * 32 |Proxy-Connection: keep-alive (C) | No Input Provided (NI) | Default timeout set to 60 - *--------------------------------------------------------------------------------------------------------------------------- - * 33 |Proxy-Connection: keep-alive (C) | -Dhttp.keepAlive.time.server=100 | Default timeout set to 60 - * | | (SERVER_100) | - *--------------------------------------------------------------------------------------------------------------------------- - * 34 |Proxy-Connection: keep-alive (C) | -Dhttp.keepAlive.time.proxy=200 | Timeout set to 200 - * | | (PROXY_200) | - *-------------------------------------------------------------------------------------------------------------------------- - * 35 |Proxy-Connection: keep-alive (C) | -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=200 | Timeout set to 200 - * | | (SERVER_100 && PROXY_200) | - *-------------------------------------------------------------------------------------------------------------------------- - * 36 |Proxy-Connection: keep-alive (C) | -Dhttp.keepAlive.time.server=-100 | Default timeout set to 60 - * | | (SERVER_100_NEGATIVE) | - *--------------------------------------------------------------------------------------------------------------------------- - * 37 |Proxy-Connection: keep-alive (C) | -Dhttp.keepAlive.time.proxy=-200 | Default timeout set to 60 - * | | (PROXY_200_NEGATIVE) | - *--------------------------------------------------------------------------------------------------------------------------- - * 38 |Proxy-Connection: keep-alive (C) |-Dhttp.keepAlive.time.server=-100 && | - * | |-Dhttp.keepAlive.time.proxy=-200 | Default timeout set to 60 - * | |(SERVER_100_NEGATIVE && PROXY_200_NEGATIVE)| - *--------------------------------------------------------------------------------------------------------------------------- - * 39 |Proxy-Connection: keep-alive (C) | -Dhttp.keepAlive.time.server=0 | Default timeout set to 60 - * | | (SERVER_ZERO) | - *--------------------------------------------------------------------------------------------------------------------------- - * 40 |Proxy-Connection: keep-alive (C) | -Dhttp.keepAlive.time.proxy=0 | close connection immediately - * | | (PROXY_ZERO) | - *--------------------------------------------------------------------------------------------------------------------------- - * 41 |Proxy-Connection: keep-alive (C) | -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=0 | close connection immediately - * | | (SERVER_ZERO && PROXY_ZERO) | - *-------------------------------------------------------------------------------------------------------------------------------- - * 42 |Proxy-Connection: keep-alive (C) | -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=-200 | Default timeout set to 60 - * | | (SERVER_ZERO && PROXY_200_NEGATIVE) | - *--------------------------------------------------------------------------------------------------------------------------------- - * 43 |Proxy-Connection: keep-alive (C) | -Dhttp.keepAlive.time.server=-100 &&| - * | | -Dhttp.keepAlive.time.proxy=0 | close connection immediately - * | | (SERVER_100_NEGATIVE && PROXY_ZERO) | - *--------------------------------------------------------------------------------------------------------------------------------- - * 44 |Proxy-Connection: keep-alive (C) | -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=0 | close connection immediately - * | | (SERVER_100 && PROXY_ZERO) | - *--------------------------------------------------------------------------------------------------------------------------- - * 45 |Proxy-Connection: keep-alive (C) | -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=200 | Timeout set to 200 - * | | (SERVER_ZERO && PROXY_200) | - *--------------------------------------------------------------------------------------------------------------------------- - * 46 |Proxy-Connection: keep-alive (C) |-Dhttp.keepAlive.time.server=100 && | - * | |-Dhttp.keepAlive.time.proxy=-200 | Default timeout set to 60 - * | | (SERVER_100 && PROXY_200_NEGATIVE) | - *--------------------------------------------------------------------------------------------------------------------------- - * 47 |Proxy-Connection: keep-alive (C) |-Dhttp.keepAlive.time.server=-100 && | - * | |-Dhttp.keepAlive.time.proxy=200 | Timeout set to 200 - * | | (SERVER_100_NEGATIVE && PROXY_ZERO) | - *--------------------------------------------------------------------------------------------------------------------------- - * 48 |Connection:keep-alive\r\nProxy-connection:keep-alive (D) | No Input Provided (NI) | Default timeout set to 60 - *----------------------------------------------------------------------------------------------------------------------------- - * 49 |Connection:keep-alive\r\nProxy-connection:keep-alive (D) | -Dhttp.keepAlive.time.server=100 | Default timeout set to 60 - * | | (SERVER_100) | - *--------------------------------------------------------------------------------------------------------------------------- - * 50 |Connection:keep-alive\r\nProxy-connection:keep-alive (D) | -Dhttp.keepAlive.time.proxy=200 | Timeout set to 200 - * | | (PROXY_200) | - *------------------------------------------------------------------------------------------------------------------------------ - * 51 |Connection:keep-alive\r\nProxy-connection:keep-alive (D) | -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=200 | Timeout set to 200 - * | | (SERVER_100 && PROXY_200) | - *------------------------------------------------------------------------------------------------------------------------------ - * 52 |Connection:keep-alive\r\nProxy-connection:keep-alive (D) | -Dhttp.keepAlive.time.server=-100 | Default timeout set to 60 - * | | (SERVER_100_NEGATIVE) | - *------------------------------------------------------------------------------------------------------------------------------ - * 53 |Connection:keep-alive\r\nProxy-connection:keep-alive (D) | -Dhttp.keepAlive.time.proxy=-200 | Default timeout set to 60 - * | | (PROXY_200_NEGATIVE) | - *------------------------------------------------------------------------------------------------------------------------------ - * 54 |Connection:keep-alive\r\nProxy-connection:keep-alive (D) | -Dhttp.keepAlive.time.server=-100&& | - * | | -Dhttp.keepAlive.time.proxy=-200 | Default timeout set to 60 - * | | (SERVER_100_NEGATIVE && PROXY_200_NEGATIVE | - *------------------------------------------------------------------------------------------------------------------------------- - * 55 |Connection:keep-alive\r\nProxy-connection:keep-alive (D) | -Dhttp.keepAlive.time.server=0 | Default timeout set to 60 - * | | (SERVER_ZERO) | - *-------------------------------------------------------------------------------------------------------------------------------- - * 56 |Connection:keep-alive\r\nProxy-connection:keep-alive (D) | -Dhttp.keepAlive.time.proxy=0 | close connection immediately - * | | (PROXY_ZERO) | - *-------------------------------------------------------------------------------------------------------------------------------- - * 57 |Connection:keep-alive\r\nProxy-connection:keep-alive (D) | -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=0 | close connection immediately - * | | (SERVER_ZERO && PROXY_ZERO) | - *-------------------------------------------------------------------------------------------------------------------------------- - * 58 |Connection:keep-alive\r\nProxy-connection:keep-alive (D) | -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=-200 | Default timeout set to 60 - * | | (SERVER_ZERO && PROXY_200_NEGATIVE) | - *-------------------------------------------------------------------------------------------------------------------------------- - * 59 |Connection:keep-alive\r\nProxy-connection:keep-alive (D) | -Dhttp.keepAlive.time.server=-100 &&| - * | | -Dhttp.keepAlive.time.proxy=0 | close connection immediately - * | | (SERVER_100_NEGATIVE && PROXY_ZERO) | - *-------------------------------------------------------------------------------------------------------------------------------- - * 60 |Connection:keep-alive\r\nProxy-connection:keep-alive (D) | -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=0 | close connection immediately - * | | (SERVER_100 && PROXY_ZERO) | - *-------------------------------------------------------------------------------------------------------------------------------- - * 61 |Connection:keep-alive\r\nProxy-connection:keep-alive (D) | -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=200 | Timeout set to 200 - * | | (SERVER_ZERO && PROXY_200) | - *------------------------------------------------------------------------------------------------------------------------------ - * 62 |Connection:keep-alive\r\nProxy-connection:keep-alive (D) | -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=-200 | default timeout set to 60 - * | | (SERVER_100 && PROXY_200_NEGATIVE) | - *------------------------------------------------------------------------------------------------------------------------------ - * 63 |Connection:keep-alive\r\nProxy-connection:keep-alive (D) | -Dhttp.keepAlive.time.server=-100 &&| - * | | -Dhttp.keepAlive.time.proxy=200 | Timeout set to 200 - * | | (SERVER_100_NEGATIVE && PROXY_200) | - *------------------------------------------------------------------------------------------------------------------------------- - * 64 |Proxy-connection:keep-alive\r\nKeep-alive:timeout=120 (E)| No Input Provided (NI) | Timeout set to 120 - *------------------------------------------------------------------------------------------------------------------------------- - * 65 |Proxy-connection:keep-alive\r\nKeep-alive:timeout=120 (E)| -Dhttp.keepAlive.time.server=100 | Timeout set to 120 - * | | (SERVER_100) | - *------------------------------------------------------------------------------------------------------------------------------- - * 66 |Proxy-connection:keep-alive\r\nKeep-alive:timeout=120 (E)| -Dhttp.keepAlive.time.proxy=200 | Timeout set to 120 - * | | (PROXY_200) | - *------------------------------------------------------------------------------------------------------------------------------- - * 67 |Proxy-connection:keep-alive\r\nKeep-alive:timeout=120 (E)| -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=200 | Timeout set to 120 - * | | (SERVER_100 && PROXY_200) | - *------------------------------------------------------------------------------------------------------------------------------- - * 68 |Proxy-connection:keep-alive\r\nKeep-alive:timeout=120 (E)| -Dhttp.keepAlive.time.server=-100 | Timeout set to 120 - * | | (SERVER_100_NEGATIVE) | - *------------------------------------------------------------------------------------------------------------------------------- - * 69 |Proxy-connection:keep-alive\r\nKeep-alive:timeout=120 (E)| -Dhttp.keepAlive.time.proxy=-200 | Timeout set to 120 - * | | (PROXY_200_NEGATIVE) | - *------------------------------------------------------------------------------------------------------------------------------- - * 70 |Proxy-connection:keep-alive\r\nKeep-alive:timeout=120 (E)| -Dhttp.keepAlive.time.server=-100 && | - * | | -Dhttp.keepAlive.time.proxy=-200 | Timeout set to 120 - * | | (SERVER_100_NEGATIVE && PROXY_200_NEGATIVE)| - *------------------------------------------------------------------------------------------------------------------------------- - * 71 |Proxy-connection:keep-alive\r\nKeep-alive:timeout=120 (E)| -Dhttp.keepAlive.time.server=0 | Timeout set to 120 - * | | (SERVER_ZERO) | - *------------------------------------------------------------------------------------------------------------------------------- - * 72 |Proxy-connection:keep-alive\r\nKeep-alive:timeout=120 (E)| -Dhttp.keepAlive.time.proxy=0 | Timeout set to 120 - * | | (PROXY_ZERO) | - *------------------------------------------------------------------------------------------------------------------------------- - * 73 |Proxy-connection:keep-alive\r\nKeep-alive:timeout=120 (E)| -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=0 | Timeout set to 120 - * | | (SERVER_ZERO && PROXY_ZERO) | - *------------------------------------------------------------------------------------------------------------------------------- - * 74 |Proxy-connection:keep-alive\r\nKeep-alive:timeout=120 (E)| -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=-200 | Timeout set to 120 - * | | (SERVER_ZERO && PROXY_200_NEGATIVE) | - *------------------------------------------------------------------------------------------------------------------------------- - * 75 |Proxy-connection:keep-alive\r\nKeep-alive:timeout=120 (E)| -Dhttp.keepAlive.time.server=-100 &&| - * | | -Dhttp.keepAlive.time.proxy=0 | Timeout set to 120 - * | | (SERVER_100_NEGATIVE && PROXY_ZERO) | - *------------------------------------------------------------------------------------------------------------------------------- - * 76 |Proxy-connection:keep-alive\r\nKeep-alive:timeout=120 (E)| -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=0 | Timeout set to 120 - * | | (SERVER_100 && PROXY_ZERO) | - *------------------------------------------------------------------------------------------------------------------------------- - * 77 |Proxy-connection:keep-alive\r\nKeep-alive:timeout=120 (E)| -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=200 | Timeout set to 120 - * | | (SERVER_ZERO && PROXY_200) | - *------------------------------------------------------------------------------------------------------------------------------- - * 78 |Proxy-connection:keep-alive\r\nKeep-alive:timeout=120 (E)| -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=-200 | Timeout set to 120 - * | | (SERVER_100_NEGATIVE && PROXY_200_NEGATIVE) | - *------------------------------------------------------------------------------------------------------------------------------- - * 79 |Proxy-connection:keep-alive\r\nKeep-alive:timeout=120 (E)| -Dhttp.keepAlive.time.server=-100 &&| - * | | -Dhttp.keepAlive.time.proxy=200 | Timeout set to 120 - * | | (SERVER_100_NEGATIVE && PROXY_200) | - *----------------------------------------------------------------------------------------------------------------------------- - * 80 |No Input (NI) | No Input Provided (NI) | default timeout set to 5 - *----------------------------------------------------------------------------------------------------------------------------- - * 81 |No Input (NI) | -Dhttp.keepAlive.time.server=100 | Timeout set to 100 - * | | (SERVER_100) | - *----------------------------------------------------------------------------------------------------------------------------- - * 82 |No Input (NI) | -Dhttp.keepAlive.time.proxy=200 | default timeout set to 5 - * | | (PROXY_200) | - *----------------------------------------------------------------------------------------------------------------------------- - * 83 |No Input (NI) | -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=200 | client timeot set to 100 - * | | (SERVER_100 && PROXY_200) | - *------------------------------------------------------------------------------------------------------------------------------ - * 84 |No Input (NI) | -Dhttp.keepAlive.time.server=-100 | default timeout set to 5 - * | | (SERVER_100_NEGATIVE) | - *------------------------------------------------------------------------------------------------------------------------------ - * 85 |No Input (NI) | -Dhttp.keepAlive.time.proxy=-200 | default timeout set to 5 - * | | (PROXY_200_NEGATIVE) | - *---------------------------------------------------------------------------------------------------------------------------- - * 86 |No Input (NI) | -Dhttp.keepAlive.time.server=-100 && | - * | | -Dhttp.keepAlive.time.proxy=-200 | default timeout set to 5 - * | | (SERVER_100_NEGATIVE && PROXY_200_NEGATIVE)| - *------------------------------------------------------------------------------------------------------------------------------ - * 87 |No Input (NI) | -Dhttp.keepAlive.time.server=0 | close connection immediately - * | | (SERVER_ZERO) | - *--------------------------------------------------------------------------------------------------------------------------------- - * 88 |No Input (NI) | -Dhttp.keepAlive.time.proxy=0 | default timeout set to 5 - * | | (PROXY_ZERO) | - *--------------------------------------------------------------------------------------------------------------------------------- - * 89 |No Input (NI) | -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=0 | close connection immediately - * | | (SERVER_ZERO && PROXY_ZERO) | - *--------------------------------------------------------------------------------------------------------------------------------- - * 90 |No Input (NI) | -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=-200 | close connection immediately - * | | (SERVER_ZERO && PROXY_200_NEGATIVE) | - *-------------------------------------------------------------------------------------------------------------------------------- - * 91 |No Input (NI) | -Dhttp.keepAlive.time.server=-100 &&| - * | | -Dhttp.keepAlive.time.proxy=0 | default timeout set to 5 - * | | (SERVER_100_NEGATIVE && PROXY_ZERO) | - *-------------------------------------------------------------------------------------------------------------------------------- - * 92 |No Input (NI) | -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=0 | Timeout set to 100 - * | | (SERVER_100 && PROXY_ZERO) | - *-------------------------------------------------------------------------------------------------------------------------------- - * 93 |No Input (NI) | -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=200 | close connection immediately - * | | (SERVER_ZERO && PROXY_200) | - *-------------------------------------------------------------------------------------------------------------------------------- - * 94 |No Input (NI) |-Dhttp.keepAlive.time.server=100 && | - * | |-Dhttp.keepAlive.time.proxy=-200 | Timeout set to 100 - * | | (SERVER_100 && PROXY_200_NEGATIVE) | - *-------------------------------------------------------------------------------------------------------------------------------- - * 95 |No Input (NI) |-Dhttp.keepAlive.time.server=-100 && | - * | |-Dhttp.keepAlive.time.proxy=200 | default timeout set to 5 - * | | (SERVER_100_NEGATIVE && PROXY_200) | - *-------------------------------------------------------------------------------------------------------------------------------- - * 96 |Connection: keep-alive\r\nKeep-alive: timeout=-20 (F) | No Input Provided (NI) | default timeout set to 5 - *-------------------------------------------------------------------------------------------------------------------------------- - * 97 |Connection: keep-alive\r\nKeep-alive: timeout=-20 (F) |-Dhttp.keepAlive.time.server=100 | Timeout set to 100 - * | | (SERVER_100) | - *-------------------------------------------------------------------------------------------------------------------------------- - * 98 |Connection: keep-alive\r\nKeep-alive: timeout=-20 (F) |-Dhttp.keepAlive.time.proxy=200 | default timeout set to 5 - * | | (PROXY_200) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 99 |Connection: keep-alive\r\nKeep-alive: timeout=-20 (F) |-Dhttp.keepAlive.time.server=100 && | - * | |-Dhttp.keepAlive.time.proxy=200 | Timeout set to 100 - * | |(SERVER_100 && PROXY_200) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 100 |Connection: keep-alive\r\nKeep-alive: timeout=-20 (F) |-Dhttp.keepAlive.time.server=-100 | default timeout set to 5 - * | |(SERVER_100_NEGATIVE) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 101 |Connection: keep-alive\r\nKeep-alive: timeout=-20 (F) |-Dhttp.keepAlive.time.proxy=-200 | default timeout set to 5 - * | |(PROXY_200_NEGATIVE) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 102 |Connection: keep-alive\r\nKeep-alive: timeout=-20 (F) |-Dhttp.keepAlive.time.server=-100 && | - * | |-Dhttp.keepAlive.time.proxy=-200 | default timeout set to 5 - * | | (SERVER_100_NEGATIVE && PROXY_200_NEGATIVE)| - *------------------------------------------------------------------------------------------------------------------------------------- - * 103 |Connection: keep-alive\r\nKeep-alive: timeout=-20 (F) |-Dhttp.keepAlive.time.server=0 | close connection immediately - * | | (SERVER_ZERO) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 104 |Connection: keep-alive\r\nKeep-alive: timeout=-20 (F) |-Dhttp.keepAlive.time.proxy=0 | default timeout set to 5 - * | | (PROXY_ZERO) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 105 |Connection: keep-alive\r\nKeep-alive: timeout=-20 (F) |-Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=0 | close connection immediately - * | | (SERVER_ZERO && PROXY_ZERO) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 106 |Connection: keep-alive\r\nKeep-alive: timeout=-20 (F) |-Dhttp.keepAlive.time.server=0 && | - * | |-Dhttp.keepAlive.time.proxy=-200 | close connection immediately - * | | (SERVER_ZERO && PROXY_ZERO_NEGATIVE)| - *------------------------------------------------------------------------------------------------------------------------------------- - * 107 |Connection: keep-alive\r\nKeep-alive: timeout=-20 (F) |-Dhttp.keepAlive.time.server=-100 && | - * | |-Dhttp.keepAlive.time.proxy=0 | default timeout set to 5 - * | | (SERVER_100_NEGATIVE && PROXY_ZERO) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 108 |Connection: keep-alive\r\nKeep-alive: timeout=-20 (F) |-Dhttp.keepAlive.time.server=100 && | - * | |-Dhttp.keepAlive.time.proxy=0 | Timeout set to 100 - * | | (SERVER_100 && PROXY_ZERO) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 109 |Connection: keep-alive\r\nKeep-alive: timeout=-20 (F) |-Dhttp.keepAlive.time.server=0 && | - * | |-Dhttp.keepAlive.time.proxy=200 | close connection immediately - * | | (SERVER_ZERO && PROXY_200) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 110 |Connection: keep-alive\r\nKeep-alive: timeout=-20 (F) |-Dhttp.keepAlive.time.server=100 && | - * | |-Dhttp.keepAlive.time.proxy=-200 | Timeout set to 100 - * | |(SERVER_100 && PROXY_200_NEGATIVE) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 111 |Connection: keep-alive\r\nKeep-alive: timeout=-20 (F) |-Dhttp.keepAlive.time.server=-100 && | - * | |-Dhttp.keepAlive.time.proxy=200 | default timeout set to 5 - * | | (SERVER_100_NEGATIVE && PROXY_200) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 112 |Connection: keep-alive\r\nKeep-alive: timeout=0 (G) | No Input Provided (NI) | close connection immediately - *------------------------------------------------------------------------------------------------------------------------------------- - * 113 |Connection: keep-alive\r\nKeep-alive: timeout=0 (G) | -Dhttp.keepAlive.time.server=100 | close connection immediately - * | | (SERVER_100) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 114 |Connection: keep-alive\r\nKeep-alive: timeout=0 (G) | -Dhttp.keepAlive.time.proxy=200 | close connection immediately - * | | (PROXY_200) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 115 |Connection: keep-alive\r\nKeep-alive: timeout=0 (G) | -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=200 | close connection immediately - * | | (SERVER_100 && PROXY_200) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 116 |Connection: keep-alive\r\nKeep-alive: timeout=0 (G) | -Dhttp.keepAlive.time.server=-100 | close connection immediately - * | | (SERVER_100_NEGATIVE) | - *------------------------------------------------------------------------------------------------------------------------------------ - * 117 |Connection: keep-alive\r\nKeep-alive: timeout=0 (G) | -Dhttp.keepAlive.time.proxy=-200 | close connection immediately - * | | (PROXY_200_NEGATIVE) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 118 |Connection: keep-alive\r\nKeep-alive: timeout=0 (G) |-Dhttp.keepAlive.time.server=-100 && | - * | |-Dhttp.keepAlive.time.proxy=-200 | close connection immediately - * | | (SERVER_100_NEGATIVE && PROXY_200_NEGATIVE) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 119 |Connection: keep-alive\r\nKeep-alive: timeout=0 (G) | -Dhttp.keepAlive.time.server=0 | close connection immediately - * | | (SERVER_ZERO) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 120 |Connection: keep-alive\r\nKeep-alive: timeout=0 (G) | -Dhttp.keepAlive.time.proxy=0 | close connection immediately - * | | (PROXY_ZERO) | - *------------------------------------------------------------------------------------------------------------------------------------ - * 121 |Connection: keep-alive\r\nKeep-alive: timeout=0 (G) | -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=0 | close connection immediately - * | | (SERVER_ZERO && PROXY_ZERO) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 122 |Connection: keep-alive\r\nKeep-alive: timeout=0 (G) | -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=-200 | close connection immediately - * | | (SERVER_ZERO && PROXY_200_NEGATIVE) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 123 |Connection: keep-alive\r\nKeep-alive: timeout=0 (G) | -Dhttp.keepAlive.time.server=-100 &&| - * | | -Dhttp.keepAlive.time.proxy=0 | close connection immediately - * | | (SERVER_100_NEGATIVE && PROXY_ZERO) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 124 |Connection: keep-alive\r\nKeep-alive: timeout=0 (G) | -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=0 | close connection immediately - * | | (SERVER_100 && PROXY_ZERO) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 125 |Connection: keep-alive\r\nKeep-alive: timeout=0 (G) | -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=200 | close connection immediately - * | | (SERVER_ZERO && PROXY_200) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 126 |Connection: keep-alive\r\nKeep-alive: timeout=0 (G) | -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=-200 | close connection immediately - * | | (SERVER_100 && PROXY_200_NEGATIVE) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 127 |Connection: keep-alive\r\nKeep-alive: timeout=0 (G) | -Dhttp.keepAlive.time.server=-100 &&| - * | | -Dhttp.keepAlive.time.proxy=200 | close connection immediately - * | | (SERVER_100_NEGATIVE && PROXY_200) | - *-------------------------------------------------------------------------------------------------------------------------------------- - * 128 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=-20 (H)| No Input Provided (NI) | default timeout set to 60 - --------------------------------------------------------------------------------------------------------------------------------------- - * 129 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=-20 (H)| -Dhttp.keepAlive.time.server=100 | default timeout set to 60 - * | | (SERVER_100) | - *-------------------------------------------------------------------------------------------------------------------------------------- - * 130 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=-20 (H)| -Dhttp.keepAlive.time.proxy=200 | Timeout set to 200 - * | | (PROXY_200) | - *-------------------------------------------------------------------------------------------------------------------------------------- - * 131 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=-20 (H)| -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=200 | Timeout set to 200 - * | | (SERVER_100 && PROXY_200) | - *-------------------------------------------------------------------------------------------------------------------------------------- - * 132 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=-20 (H)| -Dhttp.keepAlive.time.server=-100 | default timeout set to 60 - * | | (SERVER_100_NEGATIVE) | - *-------------------------------------------------------------------------------------------------------------------------------------- - * 133 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=-20 (H)| -Dhttp.keepAlive.time.proxy=-200 | default timeout set to 60 - * | | (PROXY_200_NEGATIVE) | - *-------------------------------------------------------------------------------------------------------------------------------------- - * 134 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=-20 (H)|-Dhttp.keepAlive.time.server=-100 && | - * | |-Dhttp.keepAlive.time.proxy=-200 | default timeout set to 60 - * | | (SERVER_100_NEGATIVE && PROXY_200_NEGATIVE)| - *--------------------------------------------------------------------------------------------------------------------------------- - * 135 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=-20 (H)| -Dhttp.keepAlive.time.server=0 | default timeout set to 60 - * | | (SERVER_ZERO) | - *-------------------------------------------------------------------------------------------------------------------------------------- - * 136 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=-20 (H)| -Dhttp.keepAlive.time.proxy=0 | close connection immediately - * | | (PROXY_ZERO) | - *---------------------------------------------------------------------------------------------------------------------------------- - * 137 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=-20 (H)| -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=0 | close connection immediately - * | | (SERVER_ZERO && PROXY_ZERO) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 138 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=-20 (H)| -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=-200 | default timeout set to 60 - * | | (SERVER_ZERO && PROXY_200_NEGATIVE) | - *--------------------------------------------------------------------------------------------------------------------------------------- - * 139 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=-20 (H)| -Dhttp.keepAlive.time.server=-100 && | - * | | -Dhttp.keepAlive.time.proxy=0 | close connection immediately - * | | (SERVER_100_NEGATIVE && PROXY_ZERO) | - *-------------------------------------------------------------------------------------------------------------------------------------- - * 140 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=-20 (H)| -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=0 | close connection immediately - * | | (SERVER_100 && PROXY_ZERO) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 141 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=-20 (H)| -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=200 | Timeout set to 20 - * | | (SERVER_ZERO && PROXY_200) | - *-------------------------------------------------------------------------------------------------------------------------------------- - * 142 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=-20 (H)|-Dhttp.keepAlive.time.server=100 && | - * | |-Dhttp.keepAlive.time.proxy=-200 | default timeout set to 60 - * | | (SERVER_100 && PROXY_200_NEGATIVE) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 143 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=-20 (H)|-Dhttp.keepAlive.time.server=-100 && | - * | |-Dhttp.keepAlive.time.proxy=200 | Timeout set to 200 - * | | (SERVER_100_NEGATIVE && PROXY_200) | - *-------------------------------------------------------------------------------------------------------------------------------------- - * 144 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=0 (I) | No Input Provided (NI) | close connection immediately - *-------------------------------------------------------------------------------------------------------------------------------------- - * 145 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=0 (I) | -Dhttp.keepAlive.time.server=100 | close connection immediately - * | | (SERVER_100) | - *-------------------------------------------------------------------------------------------------------------------------------------- - * 146 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=0 (I) | -Dhttp.keepAlive.time.proxy=200 | close connection immediately - * | | (PROXY_200) | - *-------------------------------------------------------------------------------------------------------------------------------------- - * 147 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=0 (I) | -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=200 | close connection immediately - * | | (SERVER_100 && PROXY_200) | - *-------------------------------------------------------------------------------------------------------------------------------------- - * 148 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=0 (I) | -Dhttp.keepAlive.time.server=-100 | close connection immediately - * | | (SERVER_100_NEGATIVE) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 149 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=0 (I) | -Dhttp.keepAlive.time.proxy=-200 | close connection immediately - * | | (PROXY_200_NEGATIVE) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 150 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=0 (I) | -Dhttp.keepAlive.time.server=-100 && | - * | | -Dhttp.keepAlive.time.proxy=-200 | close connection immediately - * | | (SERVER_100_NEGATIVE && PROXY_200_NEGATIVE) | - *------------------------------------------------------------------------------------------------------------------------------------ - * 151 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=0 (I) | -Dhttp.keepAlive.time.server=0 | close connection immediately - * | | (SERVER_ZERO) | - *----------------------------------------------------------------------------------------------------------------------------------- - * 152 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=0 (I) | -Dhttp.keepAlive.time.proxy=0 | close connection immediately - * | | (PROXY_ZERO) | - *--------------------------------------------------------------------------------------------------------------------------------- - * 153 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=0 (I) | -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=0 | close connection immediately - * | | (SERVER_ZERO && PROXY_ZERO) | - *------------------------------------------------------------------------------------------------------------------------------------ - * 154 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=0 (I) | -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=-200 | close connection immediately - * | | (SERVER_ZERO && PROXY_200_NEGATIVE) | - *-------------------------------------------------------------------------------------------------------------------------------------- - * 155 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=0 (I) | -Dhttp.keepAlive.time.server=-100 && | - * | | -Dhttp.keepAlive.time.proxy=0 | close connection immediately - * | | (SERVER_100_NEGATIVE && PROXY_ZERO) | - *------------------------------------------------------------------------------------------------------------------------------------- - * 156 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=0 (I) | -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=0 | close connection immediately - * | | (SERVER_100 && PROXY_ZERO) | - *-------------------------------------------------------------------------------------------------------------------------------------- - * 157 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=0 (I) | -Dhttp.keepAlive.time.server=0 && | - * | | -Dhttp.keepAlive.time.proxy=200 | close connection immediately - * | | (SERVER_ZERO && PROXY_200) | - *-------------------------------------------------------------------------------------------------------------------------------------- - * 158 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=0 (I) | -Dhttp.keepAlive.time.server=100 && | - * | | -Dhttp.keepAlive.time.proxy=-200 | close connection immediately - * | | (SERVER_100 && PROXY_200_NEGATIVE) | - *-------------------------------------------------------------------------------------------------------------------------------------- - * 159 |Proxy-Connection:keep-alive\r\nKeep-alive:timeout=0 (I) | -Dhttp.keepAlive.time.server=-100 && | - * | | -Dhttp.keepAlive.time.proxy=200 | close connection immediately - * | | (SERVER_100_NEGATIVE && PROXY_200) | - *-------------------------------------------------------------------------------------------------------------------------------------- - */ - - /* private static final String[] serverScenarios = { - A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, - B, B, B, B, B, B, B, B, B, B,B, B, B, B, B, B, - C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, C, - D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, D, - E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, E, - NI, NI, NI, NI, NI, NI, NI, NI, NI, NI, NI, NI, NI, NI, NI, NI, - F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, F, - G, G, G, G, G, G, G, G, G, G, G, G, G, G, G, G, - H, H, H, H, H, H, H, H, H, H, H, H, H, H, H, H, - I, I, I, I, I, I, I, I, I, I, I, I, I, I, I, I - }; */ - /* - * following are client scenarios which are repeated. - */ - private static final String[] a = { - NI, SERVER_100, PROXY_200, SERVER_100 + CLIENT_SEPARATOR + PROXY_200, SERVER_100_NEGATIVE, - PROXY_200_NEGATIVE, SERVER_100_NEGATIVE + CLIENT_SEPARATOR + PROXY_200_NEGATIVE, - SERVER_ZERO, PROXY_ZERO, SERVER_ZERO + CLIENT_SEPARATOR + PROXY_ZERO, - SERVER_ZERO + CLIENT_SEPARATOR + PROXY_200_NEGATIVE, SERVER_100_NEGATIVE + CLIENT_SEPARATOR + PROXY_ZERO, - SERVER_100 + CLIENT_SEPARATOR + PROXY_ZERO, SERVER_ZERO + CLIENT_SEPARATOR + PROXY_200, - SERVER_100 + CLIENT_SEPARATOR + PROXY_200_NEGATIVE, SERVER_100_NEGATIVE + CLIENT_SEPARATOR + PROXY_200 - }; - - /* private String[] clientScenarios = { - a[0] , a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15], - a[0] , a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15], - a[0] , a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15], - a[0] , a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15], - a[0] , a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15], - a[0] , a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15], - a[0] , a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15], - a[0] , a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15], - a[0] , a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15], - a[0] , a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15], - }; */ + private static final String CONNECTION_KEEP_ALIVE_WITH_TIMEOUT = CONNECTION_KEEP_ALIVE_ONLY + NEW_LINE + KEEP_ALIVE_TIMEOUT; - private static final String[] clientScenarios = { - a[0] , a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15] + private static final String[] serverHeaders = { + null, + CONNECTION_KEEP_ALIVE_ONLY + NEW_LINE, + CONNECTION_KEEP_ALIVE_WITH_TIMEOUT + NEW_LINE, + PROXY_CONNECTION_KEEP_ALIVE_ONLY + NEW_LINE, + PROXY_CONNECTION_KEEP_ALIVE_ONLY + NEW_LINE + CONNECTION_KEEP_ALIVE_ONLY + NEW_LINE, + PROXY_CONNECTION_KEEP_ALIVE_ONLY + NEW_LINE + KEEP_ALIVE_PROXY_TIMEOUT + NEW_LINE, + CONNECTION_KEEP_ALIVE_ONLY + NEW_LINE + KEEP_ALIVE_TIMEOUT_NEG + NEW_LINE, + CONNECTION_KEEP_ALIVE_ONLY + NEW_LINE + KEEP_ALIVE_TIMEOUT_ZERO + NEW_LINE, + PROXY_CONNECTION_KEEP_ALIVE_ONLY + NEW_LINE + KEEP_ALIVE_TIMEOUT_NEG + NEW_LINE, + PROXY_CONNECTION_KEEP_ALIVE_ONLY + NEW_LINE + KEEP_ALIVE_TIMEOUT_ZERO + NEW_LINE }; - private static final int[] expectedValues = { - 5, 100, 5, 100, 5, 5, 5, 0, 5, 0, 0, 5, 100, 0, 100, 5, - 20, 20 , 20, 20, 20, 20, 20, 20, 20, 20 , 20, 20, 20, 20, 20, 20, - 60, 60, 200, 200, 60, 60, 60, 60, 0, 0, 60, 0, 0, 200, 60, 200, - 60, 60, 200, 200, 60, 60, 60, 60, 0, 0, 60, 0, 0, 200, 60, 200, - 120, 120, 120, 120,120,120,120,120,120, 120, 120, 120, 120, 120, 120, 120, - 5, 100, 5, 100, 5, 5, 5, 0, 5, 0, 0, 5, 100, 0, 100, 5, - 5, 100, 5, 100, 5, 5, 5, 0, 5, 0, 0, 5, 100, 0, 100, 5, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - 60, 60, 200, 200, 60, 60, 60, 60, 0, 0, 60, 0, 0, 200, 60, 200, - 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, - }; + private static KeepAliveCache keepAliveCache; - private final CountDownLatch countDownLatch = new CountDownLatch(1); + private static Constructor keepAliveKeyClassconstructor; - private final CountDownLatch serverCountDownLatch = new CountDownLatch(1); + // variables set by server thread + private volatile int serverPort; + private volatile boolean isProxySet; - /* - * setting of client properties -Dhttp.keepAlive.time.server and -Dhttp.keepAlive.time.proxy is handled through this method. - * There are 16 client scenarios in total starting with scenarioNumber 0(zero) and ending with 15. - * Server Scenarios are grouped into batch of 16 scenarios. - * There are 10 batches in total and each batch contains 16 scenarios so 10 * 16 = 160 scenarios in total. - * 16 Client Scenarios are used repeatedly for every server scenario batch. - * for serverscenario[0],serverscenario[16],serverscenario[32] ... serverscenario[144] is mapped to clientscenario[0] - * for serverscenario[1],serverscenario[17],serverscenario[33] ... serverscenario[145] is mapped to clientscenario[1] - * for serverscenario[2],serverscenario[18],serverscenario[34] ... serverscenario[146] is mapped to clientscenario[2] - * ... - * for serverscenario[15],serverscenario[31],serverscenario[47] ... serverscenario[159] is mapped to clientscenario[15] - */ - private int getClientScenarioNumber(int scenarioNumber) { - return scenarioNumber % 16 ; - } - - /* - * Returns SERVER_RESPONSE as String based on integer inputParameter scenarioNumber. - * Server Scenarios are grouped into batch of 16 scenarios starting with scenarioNumber 0 (zero) - * so there are 10 batches in total and each batch contains 16 scenarios so 10 * 16 = 160 scenarios in total. - * For each batch of 16 scenarios, there will be common SERVER_RESPONSE for all 16 scenarios in batch. - * for scenario numbers from 0 to 15 server response is: Connection:keep-alive - * for scenario numbers from 16 to 31 server response is: SERVER_RESPONSE=Connection: keep-alive\r\nKeep-alive: timeout=20 - * for scenario numbers from 32 to 47 server response is: SERVER_RESPONSE=Proxy-Connection: keep-alive - * for scenario numbers from 48 to 63 server response is: SERVER_RESPONSE=Connection:keep-alive\r\nProxy-connection:keep-alive - * for scenario numbers from 64 to 79 server response is: SERVER_RESPONSE=Proxy-connection:keep-alive\r\nKeep-alive:timeout=120 - * for scenario numbers from 80 to 95 server response is: SERVER_RESPONSE=No Input - * for scenario numbers from 96 to 111 server response is: SERVER_RESPONSE=Connection: keep-alive\r\nKeep-alive: timeout=-20 - * for scenario numbers from 112 to 127 server resonse is: Connection: keep-alive\r\nKeep-alive: timeout=0 - * for scenario numbers from 128 to 143 server response is: Proxy-connection:keep-alive\r\nKeep-alive:timeout=-20 - * for scenario numbers from 144 to 159 server response is: Proxy-connection:keep-alive\r\nKeep-alive:timeout=0 - */ - private String getServerScenario(int scenarioNumber) { - /* - * ServerResponse for scenarios from 0 to 15 - * SERVER_RESPONSE:Connection:keep-alive - */ - if(scenarioNumber >= 0 && scenarioNumber <= 15) { - return A; - } - /* - * ServerResponse for scenarios from 16 to 31 - * SERVER_RESPONSE=Connection: keep-alive\r\nKeep-alive: timeout=20 - */ - else if (scenarioNumber >= 16 && scenarioNumber <= 31){ - return B; - } - /* - * ServerResponse for scenarios from 32 to 47 - * SERVER_RESPONSE=Proxy-Connection: keep-alive - */ - else if (scenarioNumber >= 32 && scenarioNumber <= 47){ - return C; - } - /* - * ServerResponse for scenarios from 48 to 63 - * SERVER_RESPONSE=Connection:keep-alive\r\nProxy-connection:keep-alive - */ - else if (scenarioNumber >= 48 && scenarioNumber <= 63){ - return D; - /* - * ServerResponse for scenarios from 64 to 79 - * SERVER_RESPONSE=Proxy-connection:keep-alive\r\nKeep-alive:timeout=120 - */ - } else if (scenarioNumber >= 64 && scenarioNumber <= 79){ - return E; - } - /* - * ServerResponse for scenarios from 80 to 95 - * SERVER_RESPONSE=No Input - */ - else if (scenarioNumber >= 80 && scenarioNumber <= 95){ - return NI; - } - /* - * ServerResponse for scenarios from 96 to 111 - * SERVER_RESPONSE=Connection: keep-alive\r\nKeep-alive: timeout=-20 - */ - else if (scenarioNumber >= 96 && scenarioNumber <= 111){ - return F; - } - /* - * ServerResponse for scenarios from 112 to 127 - * SERVER_RESPONSE=Connection: keep-alive\r\nKeep-alive: timeout=0 - */ - else if (scenarioNumber >= 112 && scenarioNumber <= 127){ - return G; - } - /* - * ServerResponse for scenarios from 128 to 143 - * SERVER_RESPONSE=Proxy-connection:keep-alive\r\nKeep-alive:timeout=-20 - */ - else if (scenarioNumber >= 128 && scenarioNumber <= 143){ - return H; - } - /* - * ServerResponse for scenarios from 144 to 159 - * SERVER_RESPONSE=Proxy-connection:keep-alive\r\nKeep-alive:timeout=0 - */ - else if (scenarioNumber >= 144 && scenarioNumber <= 159){ - return I; - } - /*Invalid Case*/ - return null; - } - - private void startScenario(int scenarioNumber) throws Exception { - System.out.println("serverScenarios[" + scenarioNumber + "]=" + getServerScenario(scenarioNumber)); - System.out.println("clientScenarios[" + scenarioNumber + "]=" + clientScenarios[getClientScenarioNumber(scenarioNumber)]); - if(expectedValues[scenarioNumber] == 0) { - System.out.println("ExpectedOutput=" + NOT_CACHED); - } else { - System.out.println("ExpectedOutput=" + expectedValues[scenarioNumber]); - } - System.out.println(); - startServer(scenarioNumber); - runClient(scenarioNumber); - } - - private void startServer(int scenarioNumber) { - Thread server = new Thread(new Runnable() { - @Override - public void run() { - try { - executeServer(scenarioNumber); - } catch (IOException e) { - e.printStackTrace(); - } - } - }, "SERVER"); - server.start(); - } + private static final Phaser serverGate = new Phaser(2); private void readAll(Socket s) throws IOException { byte[] buf = new byte[128]; @@ -1058,215 +128,209 @@ private void readAll(Socket s) throws IOException { } } - private void executeServer(int scenarioNumber) throws IOException { - String serverScenarioContent = null; - if (!getServerScenario(scenarioNumber).equalsIgnoreCase(NI)) { - serverScenarioContent = getServerScenario(scenarioNumber) + NEW_LINE; - /* - * isProxySet should be set before Server is moved to Listen State. - */ - if (serverScenarioContent.contains("Proxy")) { - isProxySet = true; - } else { - isProxySet = false; - } + private void executeServer(int scenarioNumber) { + String scenarioHeaders = serverHeaders[scenarioNumber]; + if (scenarioHeaders != null) { + // isProxySet should be set before Server is moved to Listen State. + isProxySet = scenarioHeaders.contains("Proxy"); } - ServerSocket serverSocket = null; - Socket socket = null; - OutputStreamWriter out = null; - InetAddress loopback = InetAddress.getLoopbackAddress(); - try { - serverSocket = new ServerSocket(); - serverSocket.bind(new InetSocketAddress(loopback, 0)); - SERVER_PORT = serverSocket.getLocalPort(); - //serverReady = true; - this.serverCountDownLatch.countDown(); - System.out - .println("SERVER_PORT= " + SERVER_PORT +" isProxySet=" + isProxySet); - /* - * Server will be waiting for clients to connect. - */ - socket = serverSocket.accept(); - readAll(socket); - out = new OutputStreamWriter(socket.getOutputStream()); - String BODY = "SERVER REPLY: Hello world"; - String CLEN = "Content-Length: " + BODY.length() + NEW_LINE; - /* send the header */ - out.write("HTTP/1.1 200 OK\r\n"); - out.write("Content-Type: text/plain; charset=iso-8859-1\r\n"); - /* - * append each scenario content from array. - */ - if(serverScenarioContent != null) { - out.write(serverScenarioContent); - } - out.write(CLEN); - out.write(NEW_LINE); - out.write(BODY); - out.flush(); - } catch (IOException e) { - e.printStackTrace(); - } finally { - if (out != null) { - out.flush(); - out.close(); - } - if (socket != null) { - socket.close(); - } - if (serverSocket != null) { - serverSocket.close(); + try (ServerSocket serverSocket = new ServerSocket()) { + serverSocket.bind(new InetSocketAddress(InetAddress.getLoopbackAddress(), 0)); + serverPort = serverSocket.getLocalPort(); + serverGate.arrive(); + + // Server will be waiting for clients to connect. + try (Socket socket = serverSocket.accept()) { + readAll(socket); + try (OutputStreamWriter out = new OutputStreamWriter(socket.getOutputStream())) { + String BODY = "SERVER REPLY: Hello world"; + String CLEN = "Content-Length: " + BODY.length() + NEW_LINE; + + // send common headers + out.write("HTTP/1.1 200 OK\r\n"); + out.write("Content-Type: text/plain; charset=iso-8859-1\r\n"); + + // set scenario headers + if (scenarioHeaders != null) { + out.write(scenarioHeaders); + } + + // send content + out.write(CLEN); + out.write(NEW_LINE); + out.write(BODY); + } } + } catch (IOException ioe) { + throw new RuntimeException("IOException in server thread", ioe); } } - private void runClient(int scenarioNumber) throws Exception { - try { - connectToServerURL(scenarioNumber); - } finally { - System.out.println("client count down latch:" + scenarioNumber); - this.countDownLatch.countDown(); - System.out.println(); - System.out.println(); - } - } + private void fetchInfo(int expectedValue, HttpURLConnection httpUrlConnection) throws Exception { + Object expectedKeepAliveKey = keepAliveKeyClassconstructor.newInstance(httpUrlConnection.getURL(), null); + Object clientVectorObjectInMap = keepAliveCache.get(expectedKeepAliveKey); + System.out.println("ClientVector for KeepAliveKey:" + clientVectorObjectInMap); + HttpClient httpClientCached = keepAliveCache.get(httpUrlConnection.getURL(), null); + System.out.println("HttpClient in Cache:" + httpClientCached); - private void connectToServerURL(int scenarioNumber) throws Exception { - // System.setProperty("java.net.useSystemProxies", "false"); - // System.setProperty("http.nonProxyHosts", ""); - // System.setProperty("http.proxyHost", "localhost"); - // System.setProperty("http.proxyPort", String.valueOf(SERVER_PORT)); - System.out.println("Following are Existing System Properties if set any"); - System.out.println("http.keepAlive.time.server:" + System.getProperty("http.keepAlive.time.server")); - System.out.println("http.keepAlive.time.proxy:" + System.getProperty("http.keepAlive.time.proxy")); - System.setProperty("java.net.useSystemProxies", "false"); - System.out.println("http.proxyPort:"+System.getProperty("http.proxyPort")); - System.out.println("http.proxyHost:"+System.getProperty("http.proxyHost")); - System.clearProperty("http.keepAlive.time.server"); - System.clearProperty("http.keepAlive.time.proxy"); - // fetch clientScenearios for each scenarioNumber from array and set it to - // System property. - if (!clientScenarios[getClientScenarioNumber(scenarioNumber)].equalsIgnoreCase(NI)) { - System.out.println("Client Input Parsing"); - for (String clientScenarioString : clientScenarios[getClientScenarioNumber(scenarioNumber)].split(CLIENT_SEPARATOR)) { - System.out.println(clientScenarioString); - String key = clientScenarioString.split("=")[0]; - String value = clientScenarioString.split("=")[1]; - System.setProperty(key, value); + if (httpClientCached != null) { + System.out.println("KeepingAlive:" + httpClientCached.isKeepingAlive()); + System.out.println("UsingProxy:" + httpClientCached.getUsingProxy()); + System.out.println("ProxiedHost:" + httpClientCached.getProxyHostUsed()); + System.out.println("ProxiedPort:" + httpClientCached.getProxyPortUsed()); + Class clientVectorClass = Class.forName("sun.net.www.http.ClientVector"); + Field napField = clientVectorClass.getDeclaredField("nap"); + napField.setAccessible(true); + int napValue = (int) napField.get(clientVectorObjectInMap); + int actualValue = napValue / 1000; + if (expectedValue == actualValue) { + System.out.printf("Cache time:%d\n", actualValue); + } else { + throw new RuntimeException("Sleep time of " + actualValue + " not expected (" + expectedValue + ")"); + } + } else { + if (expectedValue == 0) { + System.out.println("Connection not cached."); + } else { + throw new RuntimeException("Connection was not cached although expected with sleep time of:" + expectedValue); } } + } + + private void connectToServerURL(int expectedValue) throws Exception { // wait until ServerSocket moves to listening state. - this.serverCountDownLatch.await(); - System.out.println("client started"); - URL url = URIBuilder.newBuilder().scheme("http").loopback().port(SERVER_PORT).toURL(); - System.out.println("connecting from client to SERVER URL:" + url); + serverGate.arriveAndAwaitAdvance(); + URL url = URIBuilder.newBuilder().scheme("http").loopback().port(serverPort).toURL(); + System.out.println("connecting to server URL: " + url + ", isProxySet: " + isProxySet); HttpURLConnection httpUrlConnection = null; - /* - * isProxySet is set to true when Expected Server Response contains Proxy-Connection header. - */ + + // isProxySet is set to true when Expected Server Response contains Proxy-Connection header. if (isProxySet) { - httpUrlConnection = (sun.net.www.protocol.http.HttpURLConnection) url - .openConnection(new Proxy(Type.HTTP, new InetSocketAddress("localhost", SERVER_PORT))); + httpUrlConnection = (HttpURLConnection) url + .openConnection(new Proxy(Type.HTTP, new InetSocketAddress("localhost", serverPort))); } else { - httpUrlConnection = (sun.net.www.protocol.http.HttpURLConnection) url.openConnection(); + httpUrlConnection = (HttpURLConnection) url.openConnection(); } - InputStreamReader inputStreamReader = new InputStreamReader(httpUrlConnection.getInputStream()); - BufferedReader bufferedReader = null; - try { - bufferedReader = new BufferedReader(inputStreamReader); + + try (InputStreamReader inputStreamReader = new InputStreamReader(httpUrlConnection.getInputStream()); + BufferedReader bufferedReader = new BufferedReader(inputStreamReader)) { while (true) { - String eachLine = bufferedReader.readLine(); - if (eachLine == null) { + String line = bufferedReader.readLine(); + if (line == null) { break; } - System.out.println(eachLine); - } - } finally { - if (bufferedReader != null) { - bufferedReader.close(); + System.out.println(line); } } - // System.out.println("ResponseCode:" + httpUrlConnection.getResponseCode()); - // System.out.println("ResponseMessage:" + httpUrlConnection.getResponseMessage()); - // System.out.println("Content:" + httpUrlConnection.getContent()); - // Thread.sleep(2000); for (Entry> header : httpUrlConnection.getHeaderFields().entrySet()) { System.out.println(header.getKey() + "=" + header.getValue()); } - fetchInfo(scenarioNumber, httpUrlConnection); + fetchInfo(expectedValue, httpUrlConnection); } - private void fetchInfo(int scenarioNumber, sun.net.www.protocol.http.HttpURLConnection httpUrlConnection) - throws Exception { - Field field = Class.forName("sun.net.www.protocol.http.HttpURLConnection").getDeclaredField("http"); - field.setAccessible(true); - HttpClient httpClient = (HttpClient) field.get(httpUrlConnection); - // System.out.println("httpclient=" + httpClient); - Field keepAliveField = Class.forName("sun.net.www.http.HttpClient").getDeclaredField("kac"); - keepAliveField.setAccessible(true); - KeepAliveCache keepAliveCache = (KeepAliveCache) keepAliveField.get(httpClient); - System.out.println("keepAliveCache" + keepAliveCache); - System.out.println("SERVER URL:" + httpUrlConnection.getURL()); - /* - * create KeepAliveKey(URL,Object) object and compare created KeepAliveKey and - * existing using equals() method: KeepAliveKey.equals() - */ - Class keepAliveKeyClass = Class.forName("sun.net.www.http.KeepAliveKey"); - // System.out.println("keepAliveKeyClass=" + keepAliveKeyClass); - Constructor keepAliveKeyClassconstructor = keepAliveKeyClass.getDeclaredConstructors()[0]; - keepAliveKeyClassconstructor.setAccessible(true); - Object expectedKeepAliveKey = keepAliveKeyClassconstructor.newInstance(httpUrlConnection.getURL(), null); - System.out.println("ExpectedKeepAliveKey=" + expectedKeepAliveKey); - Object clientVectorObjectInMap = keepAliveCache.get(expectedKeepAliveKey); - System.out.println("ClientVector=" + clientVectorObjectInMap); - HttpClient httpClientCached = keepAliveCache.get(httpUrlConnection.getURL(), null); - System.out.println("HttpClient in Cache:" + httpClientCached); - if(httpClientCached != null) { - System.out.println("KeepingAlive:" + httpClientCached.isKeepingAlive()); - System.out.println("UsingProxy:" + httpClientCached.getUsingProxy()); - System.out.println("ProxiedHost:" + httpClientCached.getProxyHostUsed()); - System.out.println("ProxiedPort:" + httpClientCached.getProxyPortUsed()); - System.out.println("ProxyPortUsingSystemProperty:" + System.getProperty("http.proxyPort")); - System.out.println("ProxyHostUsingSystemProperty:" + System.getProperty("http.proxyHost")); - System.out.println("http.keepAlive.time.server=" + System.getProperty("http.keepAlive.time.server")); - System.out.println("http.keepAlive.time.proxy=" + System.getProperty("http.keepAlive.time.proxy")); - Class clientVectorClass = Class.forName("sun.net.www.http.ClientVector"); - // System.out.println("clientVectorClass=" + clientVectorClass); - Field napField = clientVectorClass.getDeclaredField("nap"); - napField.setAccessible(true); - int napValue = (int) napField.get(clientVectorObjectInMap); - int actualValue = napValue / 1000; - // System.out.println("nap=" + napValue / 1000); - System.out.printf("ExpectedOutput:%d ActualOutput:%d ", expectedValues[scenarioNumber], actualValue); - System.out.println(); - if (expectedValues[scenarioNumber] != actualValue) { - throw new RuntimeException( - "ExpectedOutput:" + expectedValues[scenarioNumber] + " ActualOutput: " + actualValue); + private int getExpectedCachingValue(int serverScenario) { + if (serverScenario == 2) { + // Connection: keep-alive && Keep-alive: timeout=20 + // + // server side keep-alive timeout is what counts here + return 20; + } else if (serverScenario == 3 || serverScenario == 4 || serverScenario == 8) { + // Proxy-Connection: keep-alive + // Connection:keep-alive && Proxy-connection:keep-alive + // Proxy-Connection:keep-alive && Keep-alive:timeout=-20 + // + // Proxy-connection:keep-alive is set, timeout could be invalid -> value of http.keepAlive.time.proxy or default of 60 + int httpKeepAliveTimeProxy; + try { + httpKeepAliveTimeProxy = Integer.valueOf(System.getProperty("http.keepAlive.time.proxy")); + } catch (NumberFormatException e) { + httpKeepAliveTimeProxy = -1; } + return httpKeepAliveTimeProxy < 0 ? 60 : httpKeepAliveTimeProxy; + } else if (serverScenario == 5) { + // Proxy-connection:keep-alive && Keep-alive:timeout=120 + // + // server side keep-alive timeout is what counts here + return 120; + } else if (serverScenario == 7 || serverScenario == 9) { + // Connection: keep-alive && Keep-alive: timeout=0 + // Proxy-Connection:keep-alive && Keep-alive:timeout=0 + // + // no caching + return 0; } else { - //executed when value is not cached. - String expected = expectedValues[scenarioNumber] == 0 ? NOT_CACHED - : String.valueOf(expectedValues[scenarioNumber]); - System.out.println("ExpectedOutput:" + expected + " ActualOutput:" + NOT_CACHED); - if (!expected.equalsIgnoreCase(NOT_CACHED)) { - throw new RuntimeException("ExpectedOutput:" + expected + " ActualOutput:" + NOT_CACHED); + // No server parameters + // Connection: keep-alive + // Connection: keep-alive && Keep-alive: timeout=-20 + // + // Nothing or Connection:keep-alive is set, timeout could be invalid -> value of http.keepAlive.time.server or default of 5 + int httpKeepAliveTimeServer; + try { + httpKeepAliveTimeServer = Integer.valueOf(System.getProperty("http.keepAlive.time.server")); + } catch (NumberFormatException e) { + httpKeepAliveTimeServer = -1; } - } + return httpKeepAliveTimeServer < 0 ? 5 : httpKeepAliveTimeServer; + } } - public static void main(String[] args) throws Exception { - if (args.length != 1) { - throw new IllegalArgumentException("Usage:java KeepAliveTest.java "); + private void runScenario(int scenarioNumber) throws Exception { + int expectedValue = getExpectedCachingValue(scenarioNumber); + System.out.println("Expecting Cache Time of " + expectedValue + " for server headers:"); + if (serverHeaders[scenarioNumber] == null) { + System.out.println(); + } else { + System.out.print(serverHeaders[scenarioNumber]); } + Thread server = new Thread(() -> executeServer(scenarioNumber)); + server.start(); + connectToServerURL(expectedValue); + server.join(); + System.out.println(); + } + + private static void initialize() throws Exception { + System.clearProperty("http.proxyPort"); + System.clearProperty("http.proxyHost"); + System.setProperty("java.net.useSystemProxies", "false"); + + Field keepAliveField = sun.net.www.http.HttpClient.class.getDeclaredField("kac"); + keepAliveField.setAccessible(true); + keepAliveCache = (KeepAliveCache) keepAliveField.get(null); + System.out.println("KeepAliveCache: " + keepAliveCache); + keepAliveKeyClassconstructor = Class.forName("sun.net.www.http.KeepAliveKey").getDeclaredConstructors()[0]; + keepAliveKeyClassconstructor.setAccessible(true); + logger.setLevel(Level.FINEST); ConsoleHandler h = new ConsoleHandler(); h.setLevel(Level.FINEST); logger.addHandler(h); - KeepAliveTest keepAliveTest = new KeepAliveTest(); - if (args.length != 0) { - keepAliveTest.startScenario(Integer.valueOf(args[0])); + + System.out.println("Client properties: http.keepAlive.time.server=" + System.getProperty("http.keepAlive.time.server") + + ", http.keepAlive.time.proxy=" + System.getProperty("http.keepAlive.time.proxy")); + } + + public static void main(String[] args) throws Exception { + if (args.length > 1) { + throw new IllegalArgumentException("Usage:java KeepAliveTest.java "); + } else if (args.length == 1) { + // an individual test scenario + try { + int scenarioNumber = Integer.valueOf(args[0]); + if (scenarioNumber < 0 || scenarioNumber > 9) { + throw new IllegalArgumentException("Scenario " + scenarioNumber + " does not exist"); + } + initialize(); + new KeepAliveTest().runScenario(scenarioNumber); + } catch (NumberFormatException e) { + throw new IllegalArgumentException("Scenario must be a number, got " + args[0]); + } + } else { + // all server scenarios + initialize(); + for (int i = 0; i < 10; i++) { + new KeepAliveTest().runScenario(i); + } } - // make main thread wait until server and client is completed. - keepAliveTest.countDownLatch.await(); } } diff --git a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java index 03f3f4fe6ac..12a177fd37d 100644 --- a/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java +++ b/test/jdk/sun/security/lib/cacerts/VerifyCACerts.java @@ -29,7 +29,7 @@ * 8223499 8225392 8232019 8234245 8233223 8225068 8225069 8243321 8243320 * 8243559 8225072 8258630 8259312 8256421 8225081 8225082 8225083 8245654 * 8305975 8304760 8307134 8295894 8314960 8317373 8317374 8318759 8319187 - * 8321408 + * 8321408 8316138 * @summary Check root CA entries in cacerts file */ import java.io.ByteArrayInputStream; @@ -48,12 +48,12 @@ public class VerifyCACerts { + File.separator + "security" + File.separator + "cacerts"; // The numbers of certs now. - private static final int COUNT = 108; + private static final int COUNT = 110; // SHA-256 of cacerts, can be generated with // shasum -a 256 cacerts | sed -e 's/../&:/g' | tr '[:lower:]' '[:upper:]' | cut -c1-95 private static final String CHECKSUM - = "81:D4:84:F6:92:78:A4:82:25:06:DC:42:25:C9:5D:6C:63:E4:99:CE:BC:ED:66:B3:8C:BA:E6:BA:6B:34:0F:01"; + = "C1:68:B4:AC:51:BF:B5:C6:FD:20:69:17:E1:AF:E4:5B:01:9B:AA:3F:C3:9A:80:A8:51:53:74:2C:A2:04:B0:FF"; // Hex formatter to upper case with ":" delimiter private static final HexFormat HEX = HexFormat.ofDelimiter(":").withUpperCase(); @@ -278,6 +278,10 @@ public class VerifyCACerts { "77:B8:2C:D8:64:4C:43:05:F7:AC:C5:CB:15:6B:45:67:50:04:03:3D:51:C6:0C:62:02:A8:E0:C3:34:67:D3:A0"); put("certainlyroote1 [jdk]", "B4:58:5F:22:E4:AC:75:6A:4E:86:12:A1:36:1C:5D:9D:03:1A:93:FD:84:FE:BB:77:8F:A3:06:8B:0F:C4:2D:C2"); + put("globalsignr46 [jdk]", + "4F:A3:12:6D:8D:3A:11:D1:C4:85:5A:4F:80:7C:BA:D6:CF:91:9D:3A:5A:88:B0:3B:EA:2C:63:72:D9:3C:40:C9"); + put("globalsigne46 [jdk]", + "CB:B9:C4:4D:84:B8:04:3E:10:50:EA:31:A6:9F:51:49:55:D7:BF:D2:E2:C6:B4:93:01:01:9A:D6:1D:9F:50:58"); } };