< prev index next >
src/java.base/windows/native/libnet/TwoStacksPlainDatagramSocketImpl.c
Print this page
rev 15720 : 8166850: No runtime error expected after calling NET_MapSocketOption
*** 1793,1805 ****
* Class: java_net_TwoStacksPlainDatagramSocketImpl
* Method: socketNativeSetOption
* Signature: (ILjava/lang/Object;)V
*/
JNIEXPORT void JNICALL
! Java_java_net_TwoStacksPlainDatagramSocketImpl_socketNativeSetOption(JNIEnv *env,jobject this,
! jint opt,jobject value) {
!
int fd=-1, fd1=-1;
int levelv4 = 0, levelv6 = 0, optnamev4 = 0, optnamev6 = 0, optlen = 0;
union {
int i;
char c;
--- 1793,1805 ----
* Class: java_net_TwoStacksPlainDatagramSocketImpl
* Method: socketNativeSetOption
* Signature: (ILjava/lang/Object;)V
*/
JNIEXPORT void JNICALL
! Java_java_net_TwoStacksPlainDatagramSocketImpl_socketNativeSetOption
! (JNIEnv *env,jobject this, jint opt,jobject value)
! {
int fd=-1, fd1=-1;
int levelv4 = 0, levelv6 = 0, optnamev4 = 0, optnamev6 = 0, optlen = 0;
union {
int i;
char c;
*** 1826,1842 ****
* Map the Java level socket option to the platform specific
* level(s) and option name(s).
*/
if (fd1 != -1) {
if (NET_MapSocketOptionV6(opt, &levelv6, &optnamev6)) {
! JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Invalid option");
return;
}
}
if (fd != -1) {
if (NET_MapSocketOption(opt, &levelv4, &optnamev4)) {
! JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Invalid option");
return;
}
}
switch (opt) {
--- 1826,1842 ----
* Map the Java level socket option to the platform specific
* level(s) and option name(s).
*/
if (fd1 != -1) {
if (NET_MapSocketOptionV6(opt, &levelv6, &optnamev6)) {
! JNU_ThrowByName(env, "java/net/SocketException", "Invalid option");
return;
}
}
if (fd != -1) {
if (NET_MapSocketOption(opt, &levelv4, &optnamev4)) {
! JNU_ThrowByName(env, "java/net/SocketException", "Invalid option");
return;
}
}
switch (opt) {
*** 2161,2173 ****
* Class: java_net_TwoStacksPlainDatagramSocketImpl
* Method: socketGetOption
* Signature: (I)Ljava/lang/Object;
*/
JNIEXPORT jobject JNICALL
! Java_java_net_TwoStacksPlainDatagramSocketImpl_socketGetOption(JNIEnv *env, jobject this,
! jint opt) {
!
int fd=-1, fd1=-1;
int level, optname, optlen;
union {
int i;
} optval = {0};
--- 2161,2173 ----
* Class: java_net_TwoStacksPlainDatagramSocketImpl
* Method: socketGetOption
* Signature: (I)Ljava/lang/Object;
*/
JNIEXPORT jobject JNICALL
! Java_java_net_TwoStacksPlainDatagramSocketImpl_socketGetOption
! (JNIEnv *env, jobject this, jint opt)
! {
int fd=-1, fd1=-1;
int level, optname, optlen;
union {
int i;
} optval = {0};
*** 2195,2211 ****
/*
* Map the Java level socket option to the platform specific
* level and option name.
*/
if (NET_MapSocketOption(opt, &level, &optname)) {
! JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Invalid option");
return NULL;
}
if (fd == -1) {
if (NET_MapSocketOptionV6(opt, &level, &optname)) {
! JNU_ThrowByName(env, JNU_JAVANETPKG "SocketException", "Invalid option");
return NULL;
}
fd = fd1; /* must be IPv6 only */
}
--- 2195,2211 ----
/*
* Map the Java level socket option to the platform specific
* level and option name.
*/
if (NET_MapSocketOption(opt, &level, &optname)) {
! JNU_ThrowByName(env, "java/net/SocketException", "Invalid option");
return NULL;
}
if (fd == -1) {
if (NET_MapSocketOptionV6(opt, &level, &optname)) {
! JNU_ThrowByName(env, "java/net/SocketException", "Invalid option");
return NULL;
}
fd = fd1; /* must be IPv6 only */
}
< prev index next >