Differences From Artifact [26659060bf]:
- File src/OFTCPSocket.m — part of check-in [813c00ccf0] at 2013-01-09 22:24:47 on branch trunk — Update copyright. (user: js, size: 15864) [annotate] [blame] [check-ins using]
To Artifact [4724c73932]:
- File
src/OFTCPSocket.m
— part of check-in
[9ddd33a258]
at
2013-01-12 17:29:24
on branch trunk
— Rename *UsingEncoding: to *WithEncoding:.
This reverts 5362941.
Even though *UsingEncoding: is what Foundation uses, *WithEncoding: is
more natural and is more consistent with the rest. Also, this means this
restores it to the API of 0.7. (user: js, size: 15860) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
309 310 311 312 313 314 315 | memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_NUMERICSERV | AI_ADDRCONFIG; snprintf(portCString, 7, "%" PRIu16, port); | | | 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 | memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_NUMERICSERV | AI_ADDRCONFIG; snprintf(portCString, 7, "%" PRIu16, port); if (getaddrinfo([host cStringWithEncoding: OF_STRING_ENCODING_NATIVE], portCString, &hints, &res0)) @throw [OFAddressTranslationFailedException exceptionWithClass: [self class] socket: self host: host]; for (res = res0; res != NULL; res = res->ai_next) { |
︙ | ︙ | |||
343 344 345 346 347 348 349 | # ifdef OF_THREADS OFDataArray *addrlist; addrlist = [[OFDataArray alloc] initWithItemSize: sizeof(char**)]; [mutex lock]; # endif | | | 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 | # ifdef OF_THREADS OFDataArray *addrlist; addrlist = [[OFDataArray alloc] initWithItemSize: sizeof(char**)]; [mutex lock]; # endif if ((he = gethostbyname([host cStringWithEncoding: OF_STRING_ENCODING_NATIVE])) == NULL) { # ifdef OF_THREADS [addrlist release]; [mutex unlock]; # endif @throw [OFAddressTranslationFailedException exceptionWithClass: [self class] |
︙ | ︙ | |||
488 489 490 491 492 493 494 | memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_NUMERICSERV | AI_ADDRCONFIG | AI_PASSIVE; snprintf(portCString, 7, "%" PRIu16, port); | | | 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 | memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; hints.ai_flags = AI_NUMERICSERV | AI_ADDRCONFIG | AI_PASSIVE; snprintf(portCString, 7, "%" PRIu16, port); if (getaddrinfo([host cStringWithEncoding: OF_STRING_ENCODING_NATIVE], portCString, &hints, &res)) @throw [OFAddressTranslationFailedException exceptionWithClass: [self class] socket: self host: host]; if ((sock = socket(res->ai_family, SOCK_STREAM, 0)) == INVALID_SOCKET) |
︙ | ︙ | |||
525 526 527 528 529 530 531 | #else struct hostent *he; # ifdef OF_THREADS [mutex lock]; # endif | | | 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 | #else struct hostent *he; # ifdef OF_THREADS [mutex lock]; # endif if ((he = gethostbyname([host cStringWithEncoding: OF_STRING_ENCODING_NATIVE])) == NULL) { # ifdef OF_THREADS [mutex unlock]; # endif @throw [OFAddressTranslationFailedException exceptionWithClass: [self class] socket: self |
︙ | ︙ |