--- old/src/java.base/windows/native/libnio/ch/DatagramDispatcher.c 2020-01-15 12:45:33.000000000 +0000 +++ new/src/java.base/windows/native/libnio/ch/DatagramDispatcher.c 2020-01-15 12:45:32.000000000 +0000 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2002, 2020, 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 @@ -23,21 +23,19 @@ * questions. */ -/* - */ - #include #include #include + #include "jni.h" #include "jni_util.h" #include "jvm.h" #include "jlong.h" -#include "sun_nio_ch_DatagramDispatcher.h" - #include "nio.h" #include "nio_util.h" +#include "sun_nio_ch_DatagramDispatcher.h" + /************************************************************** * DatagramDispatcher.c @@ -45,7 +43,7 @@ JNIEXPORT jint JNICALL Java_sun_nio_ch_DatagramDispatcher_read0(JNIEnv *env, jclass clazz, jobject fdo, - jlong address, jint len) + jlong address, jint len) { /* set up */ int i = 0; @@ -69,16 +67,18 @@ if (i == SOCKET_ERROR) { int theErr = (jint)WSAGetLastError(); - if (theErr == WSAEWOULDBLOCK) { - return IOS_UNAVAILABLE; - } - if (theErr == WSAECONNRESET) { - purgeOutstandingICMP(env, clazz, fd); - JNU_ThrowByName(env, JNU_JAVANETPKG "PortUnreachableException", 0); + if (theErr != WSAEMSGSIZE) { + if (theErr == WSAEWOULDBLOCK) { + return IOS_UNAVAILABLE; + } + if (theErr == WSAECONNRESET) { + purgeOutstandingICMP(env, clazz, fd); + JNU_ThrowByName(env, JNU_JAVANETPKG "PortUnreachableException", 0); + return IOS_THROWN; + } + JNU_ThrowIOExceptionWithLastError(env, "WSARecv failed"); return IOS_THROWN; } - JNU_ThrowIOExceptionWithLastError(env, "Write failed"); - return IOS_THROWN; } return convertReturnVal(env, (jint)read, JNI_TRUE); @@ -104,7 +104,7 @@ for(i=0; i