ObjFW  Check-in [541b33d978]

Overview
Comment:OFTCPSocket: Set ai_flags.

For connect(), this sets ai_flags to:
AI_NUMERICSERV | AI_ADDRCONFIG

For bind(), this sets ai_flags to:
AI_NUMERICSERV | AI_ADDRCONFIG | AI_PASSIVE

Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 541b33d9781aa9d5d4e8205de4c2ddec9e69d63ddfc5643a8f65862628bc3483
User & Date: js on 2013-01-09 22:10:44
Other Links: manifest | tags
Context
2013-01-09
22:13
OFTCPSocket: Use getnameinfo with NI_NUMERICSERV. check-in: 9a9a02555d user: js tags: trunk
22:10
OFTCPSocket: Set ai_flags. check-in: 541b33d978 user: js tags: trunk
2013-01-08
12:33
OFString: Add methods for UTF-32. check-in: 7cddd5f891 user: js tags: trunk
Changes

Modified src/OFTCPSocket.m from [fdb5be2048] to [b609afae72].

306
307
308
309
310
311
312

313
314
315
316
317
318
319
#ifdef HAVE_THREADSAFE_GETADDRINFO
	struct addrinfo hints, *res, *res0;
	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







>







306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
#ifdef HAVE_THREADSAFE_GETADDRINFO
	struct addrinfo hints, *res, *res0;
	char portCString[7];

	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 cStringUsingEncoding: OF_STRING_ENCODING_NATIVE],
	    portCString, &hints, &res0))
		@throw [OFAddressTranslationFailedException
		    exceptionWithClass: [self class]
				socket: self
484
485
486
487
488
489
490

491
492
493
494
495
496
497
#ifdef HAVE_THREADSAFE_GETADDRINFO
	struct addrinfo hints, *res;
	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







>







485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
#ifdef HAVE_THREADSAFE_GETADDRINFO
	struct addrinfo hints, *res;
	char portCString[7];

	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 cStringUsingEncoding: OF_STRING_ENCODING_NATIVE],
	    portCString, &hints, &res))
		@throw [OFAddressTranslationFailedException
		    exceptionWithClass: [self class]
				socket: self