comparison src/windows/native/java/net/TwoStacksPlainSocketImpl.c @ 6685:95eeca6dc691

8015743: Address internet addresses Summary: moved Inet6Address fields to holder class Reviewed-by: chegar, alanb, skoivu, khazra
author michaelm
date Wed, 03 Jul 2013 17:54:38 +0100
parents 8dd8266a2f4b
children 13473046fdfe
comparison
equal deleted inserted replaced
7:476a86689814 8:5dcd000da663
726 726
727 setInetAddress_addr(env, socketAddressObj, ntohl(him.him4.sin_addr.s_addr)); 727 setInetAddress_addr(env, socketAddressObj, ntohl(him.him4.sin_addr.s_addr));
728 setInetAddress_family(env, socketAddressObj, IPv4); 728 setInetAddress_family(env, socketAddressObj, IPv4);
729 (*env)->SetObjectField(env, socket, psi_addressID, socketAddressObj); 729 (*env)->SetObjectField(env, socket, psi_addressID, socketAddressObj);
730 } else { 730 } else {
731 jbyteArray addr;
732 /* AF_INET6 -> Inet6Address */ 731 /* AF_INET6 -> Inet6Address */
733 if (inet6Cls == 0) { 732 if (inet6Cls == 0) {
734 jclass c = (*env)->FindClass(env, "java/net/Inet6Address"); 733 jclass c = (*env)->FindClass(env, "java/net/Inet6Address");
735 if (c != NULL) { 734 if (c != NULL) {
736 inet6Cls = (*env)->NewGlobalRef(env, c); 735 inet6Cls = (*env)->NewGlobalRef(env, c);
749 * exist (there will be a pending exception). 748 * exist (there will be a pending exception).
750 */ 749 */
751 NET_SocketClose(fd); 750 NET_SocketClose(fd);
752 return; 751 return;
753 } 752 }
754 addr = (*env)->GetObjectField (env, socketAddressObj, ia6_ipaddressID); 753 setInet6Address_ipaddress(env, socketAddressObj, (const char *)&him.him6.sin6_addr);
755 (*env)->SetByteArrayRegion (env, addr, 0, 16, (const char *)&him.him6.sin6_addr); 754
756 setInetAddress_family(env, socketAddressObj, IPv6); 755 setInetAddress_family(env, socketAddressObj, IPv6);
757 (*env)->SetIntField(env, socketAddressObj, ia6_scopeidID, him.him6.sin6_scope_id); 756 setInet6Address_scopeid(env, socketAddressObj, him.him6.sin6_scope_id);
758 } 757 }
759 /* fields common to AF_INET and AF_INET6 */ 758 /* fields common to AF_INET and AF_INET6 */
760 759
761 port = ntohs ((u_short) GET_PORT (&him)); 760 port = ntohs ((u_short) GET_PORT (&him));
762 (*env)->SetIntField(env, socket, psi_portID, (int)port); 761 (*env)->SetIntField(env, socket, psi_portID, (int)port);