Differences From Artifact [85e7c00ebd]:
- File src/OFSocket.m — part of check-in [b29f11ed25] at 2022-10-22 16:41:01 on branch trunk — OF[IS]PX(Stream)Socket: Bind with network & node (user: js, size: 22619) [annotate] [blame] [check-ins using]
To Artifact [d0ea6d0ea9]:
- File
src/OFSocket.m
— part of check-in
[a54730b88f]
at
2022-10-22 18:41:45
on branch trunk
— OFSocket: Don't combine port for IP and IPX
While it works for those two protocols, it's a bad precedent as other
protocols have different types for ports. (user: js, size: 22894) [annotate] [blame] [check-ins using] [more...]
︙ | ︙ | |||
834 835 836 837 838 839 840 | return IPv6String(address); default: @throw [OFInvalidArgumentException exception]; } } void | | < < < | < < | 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 | return IPv6String(address); default: @throw [OFInvalidArgumentException exception]; } } void OFSocketAddressSetIPPort(OFSocketAddress *address, uint16_t port) { switch (address->family) { case OFSocketAddressFamilyIPv4: address->sockaddr.in.sin_port = OFToBigEndian16(port); break; case OFSocketAddressFamilyIPv6: address->sockaddr.in6.sin6_port = OFToBigEndian16(port); break; default: @throw [OFInvalidArgumentException exception]; } } uint16_t OFSocketAddressIPPort(const OFSocketAddress *address) { switch (address->family) { case OFSocketAddressFamilyIPv4: return OFFromBigEndian16(address->sockaddr.in.sin_port); case OFSocketAddressFamilyIPv6: return OFFromBigEndian16(address->sockaddr.in6.sin6_port); default: @throw [OFInvalidArgumentException exception]; } } OFString * OFSocketAddressUNIXPath(const OFSocketAddress *_Nonnull address) |
︙ | ︙ | |||
931 932 933 934 935 936 937 | unsigned char node[IPX_NODE_LEN]) { if (address->family != OFSocketAddressFamilyIPX) @throw [OFInvalidArgumentException exception]; memcpy(node, address->sockaddr.ipx.sipx_node, IPX_NODE_LEN); } | > > > > > > > > > > > > > > > > > > | 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 | unsigned char node[IPX_NODE_LEN]) { if (address->family != OFSocketAddressFamilyIPX) @throw [OFInvalidArgumentException exception]; memcpy(node, address->sockaddr.ipx.sipx_node, IPX_NODE_LEN); } void OFSocketAddressSetIPXPort(OFSocketAddress *address, uint16_t port) { if (address->family != OFSocketAddressFamilyIPX) @throw [OFInvalidArgumentException exception]; address->sockaddr.ipx.sipx_port = OFToBigEndian16(port); } uint16_t OFSocketAddressIPXPort(const OFSocketAddress *address) { if (address->family != OFSocketAddressFamilyIPX) @throw [OFInvalidArgumentException exception]; return OFFromBigEndian16(address->sockaddr.ipx.sipx_port); } |