ObjFW  Check-in [9a9a02555d]

Overview
Comment:OFTCPSocket: Use getnameinfo with NI_NUMERICSERV.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 9a9a02555de4bbd5838795a22dbfd6d24506267e10c705a2adb385b5a09fb33d
User & Date: js on 2013-01-09 22:13:20
Other Links: manifest | tags
Context
2013-01-09
22:24
Update copyright. check-in: 813c00ccf0 user: js tags: trunk
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
Changes

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

685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
			      selector: _cmd];

#ifdef HAVE_THREADSAFE_GETADDRINFO
	host = [self allocMemoryWithSize: NI_MAXHOST];

	@try {
		if (getnameinfo((struct sockaddr*)sockAddr, sockAddrLen, host,
		    NI_MAXHOST, NULL, 0, NI_NUMERICHOST))
			@throw [OFAddressTranslationFailedException
			    exceptionWithClass: [self class]];

		return [OFString stringWithCString: host
					  encoding: OF_STRING_ENCODING_NATIVE];
	} @finally {
		[self freeMemory: host];







|







685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
			      selector: _cmd];

#ifdef HAVE_THREADSAFE_GETADDRINFO
	host = [self allocMemoryWithSize: NI_MAXHOST];

	@try {
		if (getnameinfo((struct sockaddr*)sockAddr, sockAddrLen, host,
		    NI_MAXHOST, NULL, 0, NI_NUMERICHOST | NI_NUMERICSERV))
			@throw [OFAddressTranslationFailedException
			    exceptionWithClass: [self class]];

		return [OFString stringWithCString: host
					  encoding: OF_STRING_ENCODING_NATIVE];
	} @finally {
		[self freeMemory: host];