Skip to content

Commit c84adc4

Browse files
committed
Merge
2 parents 8d5c738 + aae25ad commit c84adc4

File tree

9 files changed

+524
-34
lines changed

9 files changed

+524
-34
lines changed

hotspot/src/os/windows/vm/os_windows.cpp

+7-3
Original file line numberDiff line numberDiff line change
@@ -1820,9 +1820,13 @@ void os::win32::print_windows_version(outputStream* st) {
18201820
if (is_workstation) {
18211821
st->print("10");
18221822
} else {
1823-
// distinguish Windows Server 2016 and 2019 by build number
1824-
// Windows server 2019 GA 10/2018 build number is 17763
1825-
if (build_number > 17762) {
1823+
// distinguish Windows Server by build number
1824+
// - 2016 GA 10/2016 build: 14393
1825+
// - 2019 GA 11/2018 build: 17763
1826+
// - 2022 GA 08/2021 build: 20348
1827+
if (build_number > 20347) {
1828+
st->print("Server 2022");
1829+
} else if (build_number > 17762) {
18261830
st->print("Server 2019");
18271831
} else {
18281832
st->print("Server 2016");

hotspot/src/share/vm/classfile/altHashing.cpp

+20-13
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,23 @@
2626
* halfsiphash code adapted from reference implementation
2727
* (https://github.com/veorq/SipHash/blob/master/halfsiphash.c)
2828
* which is distributed with the following copyright:
29-
*
30-
* SipHash reference C implementation
31-
*
32-
* Copyright (c) 2016 Jean-Philippe Aumasson <[email protected]>
33-
*
34-
* To the extent possible under law, the author(s) have dedicated all copyright
35-
* and related and neighboring rights to this software to the public domain
36-
* worldwide. This software is distributed without any warranty.
37-
*
38-
* You should have received a copy of the CC0 Public Domain Dedication along
39-
* with this software. If not, see
40-
* <http://creativecommons.org/publicdomain/zero/1.0/>.
29+
*/
30+
31+
/*
32+
SipHash reference C implementation
33+
34+
Copyright (c) 2012-2021 Jean-Philippe Aumasson
35+
36+
Copyright (c) 2012-2014 Daniel J. Bernstein <[email protected]>
37+
38+
To the extent possible under law, the author(s) have dedicated all copyright
39+
and related and neighboring rights to this software to the public domain
40+
worldwide. This software is distributed without any warranty.
41+
42+
You should have received a copy of the CC0 Public Domain Dedication along
43+
with
44+
this software. If not, see
45+
<http://creativecommons.org/publicdomain/zero/1.0/>.
4146
*/
4247

4348
#include "precompiled.hpp"
@@ -133,7 +138,9 @@ static uint64_t halfsiphash_finish64(uint32_t v[4], int rounds) {
133138
}
134139

135140
// HalfSipHash-2-4 (32-bit output) for Symbols
136-
uint32_t AltHashing::halfsiphash_32(uint64_t seed, const uint8_t* data, int len) {
141+
uint32_t AltHashing::halfsiphash_32(uint64_t seed, const void* in, int len) {
142+
143+
const unsigned char* data = (const unsigned char*)in;
137144
uint32_t v[4];
138145
uint32_t newdata;
139146
int off = 0;

hotspot/src/share/vm/classfile/altHashing.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 2012, 2021, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -47,7 +47,7 @@ class AltHashing : AllStatic {
4747
static uint64_t compute_seed();
4848

4949
// For Symbols
50-
static uint32_t halfsiphash_32(uint64_t seed, const uint8_t* data, int len);
50+
static uint32_t halfsiphash_32(uint64_t seed, const void* in, int len);
5151
// For Strings
5252
static uint32_t halfsiphash_32(uint64_t seed, const uint16_t* data, int len);
5353
NOT_PRODUCT(static void test_alt_hash();)

jdk/src/share/classes/sun/net/www/http/HttpClient.java

+15-11
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1994, 2017, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1994, 2019, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -696,11 +696,7 @@ public boolean parseHTTP(MessageHeader responses, ProgressSource pi, HttpURLConn
696696
} else {
697697
// try once more
698698
openServer();
699-
if (needsTunneling()) {
700-
MessageHeader origRequests = requests;
701-
httpuc.doTunneling();
702-
requests = origRequests;
703-
}
699+
checkTunneling(httpuc);
704700
afterConnect();
705701
writeRequests(requests, poster);
706702
return parseHTTP(responses, pi, httpuc);
@@ -711,6 +707,18 @@ public boolean parseHTTP(MessageHeader responses, ProgressSource pi, HttpURLConn
711707

712708
}
713709

710+
// Check whether tunnel must be open and open it if necessary
711+
// (in the case of HTTPS with proxy)
712+
private void checkTunneling(HttpURLConnection httpuc) throws IOException {
713+
if (needsTunneling()) {
714+
MessageHeader origRequests = requests;
715+
PosterOutputStream origPoster = poster;
716+
httpuc.doTunneling();
717+
requests = origRequests;
718+
poster = origPoster;
719+
}
720+
}
721+
714722
private boolean parseHTTPHeader(MessageHeader responses, ProgressSource pi, HttpURLConnection httpuc)
715723
throws IOException {
716724
/* If "HTTP/*" is found in the beginning, return true. Let
@@ -838,11 +846,7 @@ private boolean parseHTTPHeader(MessageHeader responses, ProgressSource pi, Http
838846
closeServer();
839847
cachedHttpClient = false;
840848
openServer();
841-
if (needsTunneling()) {
842-
MessageHeader origRequests = requests;
843-
httpuc.doTunneling();
844-
requests = origRequests;
845-
}
849+
checkTunneling(httpuc);
846850
afterConnect();
847851
writeRequests(requests, poster);
848852
return parseHTTP(responses, pi, httpuc);

jdk/src/share/instrument/InvocationAdapter.c

+1
Original file line numberDiff line numberDiff line change
@@ -854,4 +854,5 @@ appendBootClassPath( JPLISAgent* agent,
854854
if (haveBasePath && parent != canonicalPath) {
855855
free(parent);
856856
}
857+
free(paths);
857858
}

jdk/src/windows/native/java/lang/java_props_md.c

+7-2
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ GetJavaProperties(JNIEnv* env)
391391
GetVersionEx((OSVERSIONINFO *) &ver);
392392
majorVersion = ver.dwMajorVersion;
393393
minorVersion = ver.dwMinorVersion;
394-
/* distinguish Windows Server 2016 and 2019 by build number */
394+
/* distinguish Windows Server 2016+ by build number */
395395
buildNumber = ver.dwBuildNumber;
396396
is_workstation = (ver.wProductType == VER_NT_WORKSTATION);
397397
platformId = ver.dwPlatformId;
@@ -476,6 +476,8 @@ GetJavaProperties(JNIEnv* env)
476476
* Windows Server 2016 10 0 (!VER_NT_WORKSTATION)
477477
* Windows Server 2019 10 0 (!VER_NT_WORKSTATION)
478478
* where (buildNumber > 17762)
479+
* Windows Server 2022 10 0 (!VER_NT_WORKSTATION)
480+
* where (buildNumber > 20347)
479481
*
480482
* This mapping will presumably be augmented as new Windows
481483
* versions are released.
@@ -551,7 +553,10 @@ GetJavaProperties(JNIEnv* env)
551553
switch (minorVersion) {
552554
case 0:
553555
/* Windows server 2019 GA 10/2018 build number is 17763 */
554-
if (buildNumber > 17762) {
556+
/* Windows server 2022 build number is 20348 */
557+
if (buildNumber > 20347) {
558+
sprops.os_name = "Windows Server 2022";
559+
} else if (buildNumber > 17676) {
555560
sprops.os_name = "Windows Server 2019";
556561
} else {
557562
sprops.os_name = "Windows Server 2016";

0 commit comments

Comments
 (0)