Differences From Artifact [d55696187d]:
- File
src/OFTCPSocket.m
— part of check-in
[1abe5a111f]
at
2012-12-13 20:53:19
on branch trunk
— Add of_tls_socket_class for 3rd-party TLS libs.
This removes of_http_client_tls_socket_class in favor of having one
symbol for all places where TLS would be desired. (user: js, size: 15340) [annotate] [blame] [check-ins using]
To Artifact [a9ec628526]:
- File src/OFTCPSocket.m — part of check-in [e2f4c1283c] at 2012-12-15 23:31:17 on branch trunk — OFString: Improved API for getting C strings. (user: js, size: 15344) [annotate] [blame] [check-ins using]
︙ | ︙ | |||
308 309 310 311 312 313 314 | char portCString[7]; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; snprintf(portCString, 7, "%" PRIu16, port); | | | 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 | char portCString[7]; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; snprintf(portCString, 7, "%" PRIu16, port); if (getaddrinfo([host cStringUsingEncoding: 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) { |
︙ | ︙ | |||
342 343 344 345 346 347 348 | # ifdef OF_THREADS OFDataArray *addrlist; addrlist = [[OFDataArray alloc] initWithItemSize: sizeof(char**)]; [mutex lock]; # endif | | | 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 | # ifdef OF_THREADS OFDataArray *addrlist; addrlist = [[OFDataArray alloc] initWithItemSize: sizeof(char**)]; [mutex lock]; # endif if ((he = gethostbyname([host cStringUsingEncoding: OF_STRING_ENCODING_NATIVE])) == NULL) { # ifdef OF_THREADS [addrlist release]; [mutex unlock]; # endif @throw [OFAddressTranslationFailedException exceptionWithClass: [self class] |
︙ | ︙ | |||
485 486 487 488 489 490 491 | char portCString[7]; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; snprintf(portCString, 7, "%" PRIu16, port); | | | 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 | char portCString[7]; memset(&hints, 0, sizeof(struct addrinfo)); hints.ai_family = AF_UNSPEC; hints.ai_socktype = SOCK_STREAM; snprintf(portCString, 7, "%" PRIu16, port); if (getaddrinfo([host cStringUsingEncoding: 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) |
︙ | ︙ | |||
516 517 518 519 520 521 522 | #else struct hostent *he; # ifdef OF_THREADS [mutex lock]; # endif | | | 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 | #else struct hostent *he; # ifdef OF_THREADS [mutex lock]; # endif if ((he = gethostbyname([host cStringUsingEncoding: OF_STRING_ENCODING_NATIVE])) == NULL) { # ifdef OF_THREADS [mutex unlock]; # endif @throw [OFAddressTranslationFailedException exceptionWithClass: [self class] socket: self |
︙ | ︙ |