mirror of
https://github.com/openjdk/jdk.git
synced 2026-07-12 20:18:00 +00:00
6916922: (sctp) SO_RCVBUF & SO_SNDBUF returns twice the value set
Reviewed-by: alanb
This commit is contained in:
parent
152798a7ef
commit
c5c869ce94
@ -484,7 +484,7 @@ JNIEXPORT void JNICALL Java_sun_nio_ch_SctpNet_setIntOption0
|
||||
arglen = sizeof(arg);
|
||||
}
|
||||
|
||||
if (setsockopt(fd, klevel, kopt, parg, arglen) < 0) {
|
||||
if (NET_SetSockOpt(fd, klevel, kopt, parg, arglen) < 0) {
|
||||
JNU_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
|
||||
"sun_nio_ch_SctpNet.setIntOption0");
|
||||
}
|
||||
@ -517,7 +517,7 @@ JNIEXPORT int JNICALL Java_sun_nio_ch_SctpNet_getIntOption0
|
||||
arglen = sizeof(result);
|
||||
}
|
||||
|
||||
if (getsockopt(fd, klevel, kopt, arg, &arglen) < 0) {
|
||||
if (NET_GetSockOpt(fd, klevel, kopt, arg, &arglen) < 0) {
|
||||
JNU_ThrowByNameWithLastError(env, JNU_JAVANETPKG "SocketException",
|
||||
"sun.nio.ch.Net.getIntOption");
|
||||
return -1;
|
||||
|
||||
@ -104,7 +104,9 @@ public class SocketOptionTests {
|
||||
sc.setOption(SCTP_NODELAY, true);
|
||||
checkOption(sc, SCTP_NODELAY, true);
|
||||
sc.setOption(SO_SNDBUF, 16*1024);
|
||||
checkOption(sc, SO_SNDBUF, 16*1024);
|
||||
sc.setOption(SO_RCVBUF, 16*1024);
|
||||
checkOption(sc, SO_RCVBUF, 16*1024);
|
||||
checkOption(sc, SO_LINGER, -1); /* default should be negative */
|
||||
sc.setOption(SO_LINGER, 2000);
|
||||
checkOption(sc, SO_LINGER, 2000);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user