mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8203672: JNI exception pending in PlainSocketImpl.c
8203264: JNI exception pending in PlainDatagramSocketImpl.c:740 8203673: JNI exception pending in DualStackPlainDatagramSocketImpl.c:398 Reviewed-by: chegar, igerasim
This commit is contained in:
parent
4663065fad
commit
19e69dc84f
3 changed files with 25 additions and 20 deletions
|
@ -684,19 +684,21 @@ Java_java_net_PlainDatagramSocketImpl_peekData(JNIEnv *env, jobject this,
|
|||
packetAddress = NULL;
|
||||
}
|
||||
}
|
||||
if (packetAddress == NULL) {
|
||||
packetAddress = NET_SockaddrToInetAddress(env, &rmtaddr, &port);
|
||||
/* stuff the new Inetaddress in the packet */
|
||||
(*env)->SetObjectField(env, packet, dp_addressID, packetAddress);
|
||||
} else {
|
||||
/* only get the new port number */
|
||||
port = NET_GetPortFromSockaddr(&rmtaddr);
|
||||
if (!(*env)->ExceptionCheck(env)){
|
||||
if (packetAddress == NULL ) {
|
||||
packetAddress = NET_SockaddrToInetAddress(env, &rmtaddr, &port);
|
||||
/* stuff the new InetAddress in the packet */
|
||||
(*env)->SetObjectField(env, packet, dp_addressID, packetAddress);
|
||||
} else {
|
||||
/* only get the new port number */
|
||||
port = NET_GetPortFromSockaddr(&rmtaddr);
|
||||
}
|
||||
/* and fill in the data, remote address/port and such */
|
||||
(*env)->SetByteArrayRegion(env, packetBuffer, packetBufferOffset, n,
|
||||
(jbyte *)fullPacket);
|
||||
(*env)->SetIntField(env, packet, dp_portID, port);
|
||||
(*env)->SetIntField(env, packet, dp_lengthID, n);
|
||||
}
|
||||
/* and fill in the data, remote address/port and such */
|
||||
(*env)->SetByteArrayRegion(env, packetBuffer, packetBufferOffset, n,
|
||||
(jbyte *)fullPacket);
|
||||
(*env)->SetIntField(env, packet, dp_portID, port);
|
||||
(*env)->SetIntField(env, packet, dp_lengthID, n);
|
||||
}
|
||||
|
||||
if (mallocedPacket) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue