Overview
Comment: | OFUNIXDatagramSocket: Allow binding to nil path |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | trunk |
Files: | files | file ages | folders |
SHA3-256: |
36c65b846863546e951116bdc5e16507 |
User & Date: | js on 2023-07-16 17:53:24 |
Other Links: | manifest | tags |
Context
2023-07-17
| ||
19:24 | Fix building for MorphOS check-in: 3f1ba8d396 user: js tags: trunk | |
2023-07-16
| ||
17:53 | OFUNIXDatagramSocket: Allow binding to nil path check-in: 36c65b8468 user: js tags: trunk | |
2023-07-15
| ||
23:44 | Never set mutationsPtr to self check-in: 27d8eb922d user: js tags: trunk | |
Changes
Modified src/OFDatagramSocket.m from [0e772bf0c7] to [e6fec3137b].
︙ | |||
194 195 196 197 198 199 200 | 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 | - - - - + + + + + + + - - - + + + - - - + + + - - - + + + - - - + + + - - - - + + + + + + | @throw [OFReadFailedException exceptionWithObject: self requestedLength: length errNo: OFSocketErrNo()]; #endif if (sender != NULL) { |
︙ |
Modified src/OFSocket.h from [413740135d] to [ef7090ccb7].
︙ | |||
314 315 316 317 318 319 320 | 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 | - + | /** * @brief Gets the UNIX socket path of the specified @ref OFSocketAddress. * * @param address The address on which to get the UNIX socket path * @return The UNIX socket path */ |
︙ |
Modified src/OFSocket.m from [f0f36303c9] to [602607c474].
︙ | |||
975 976 977 978 979 980 981 982 983 984 985 986 987 988 | 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 | + + | OFSocketAddressString(const OFSocketAddress *address) { switch (address->family) { case OFSocketAddressFamilyIPv4: return IPv4String(address); case OFSocketAddressFamilyIPv6: return IPv6String(address); case OFSocketAddressFamilyUNIX: return OFSocketAddressUNIXPath(address); case OFSocketAddressFamilyIPX: return IPXString(address); case OFSocketAddressFamilyAppleTalk: return appleTalkString(address); default: @throw [OFInvalidArgumentException exception]; } |
︙ | |||
1026 1027 1028 1029 1030 1031 1032 | 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 | - - - | length = address->length - offsetof(struct sockaddr_un, sun_path); for (socklen_t i = 0; i < length; i++) if (address->sockaddr.un.sun_path[i] == 0) length = i; |
︙ |
Modified src/OFUNIXDatagramSocket.h from [e48f72b594] to [9e7d13dbcb].
︙ | |||
59 60 61 62 63 64 65 | 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | - - + + + - + | */ @property OF_NULLABLE_PROPERTY (assign, nonatomic) id <OFUNIXDatagramSocketDelegate> delegate; /** * @brief Bind the socket to the specified path. * |
Modified src/OFUNIXDatagramSocket.m from [8a5a642655] to [05859378eb].
︙ | |||
36 37 38 39 40 41 42 | 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 | + - - - - + + + + + + + + + - - - + + + - - + + - - - - + + + + + | #if SOCK_CLOEXEC == 0 && defined(HAVE_FCNTL_H) && defined(FD_CLOEXEC) int flags; #endif if (_socket != OFInvalidSocketHandle) @throw [OFAlreadyOpenException exceptionWithObject: self]; if (path != nil) |
Modified tests/OFUNIXStreamSocketTests.m from [d941ba25ca] to [810201952c].
︙ | |||
77 78 79 80 81 82 83 | 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 | - - + + | TEST(@"-[writeBuffer:length:]", R([sockAccepted writeBuffer: "Hello" length: 5])) TEST(@"-[readIntoBuffer:length:]", [sockClient readIntoBuffer: buffer length: 5] == 5 && memcmp(buffer, "Hello", 5) == 0) |