ObjFW  Diff

Differences From Artifact [a07fe0ff30]:

To Artifact [9669c4a7c7]:


139
140
141
142
143
144
145
146

147
148
149
150
151
152
153
		struct sockaddr_in *addrs, *addrsIter;

		/*
		 * If the host is an IP address, don't try resolving it. On the
		 * Wii for example, the resolver will return an error if you
		 * specify an IP address.
		 */
		if ((s_addr = inet_addr([host UTF8String])) != INADDR_NONE) {

			of_resolver_result_t *tmp;
			struct sockaddr_in *addr;

			if ((ret = calloc(2, sizeof(*ret))) == NULL)
				@throw [OFOutOfMemoryException
				    exceptionWithRequestedSize: 2 *
								sizeof(*ret)];







|
>







139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
		struct sockaddr_in *addrs, *addrsIter;

		/*
		 * If the host is an IP address, don't try resolving it. On the
		 * Wii for example, the resolver will return an error if you
		 * specify an IP address.
		 */
		if ((s_addr = inet_addr((const void *)[host UTF8String])) !=
		    INADDR_NONE) {
			of_resolver_result_t *tmp;
			struct sockaddr_in *addr;

			if ((ret = calloc(2, sizeof(*ret))) == NULL)
				@throw [OFOutOfMemoryException
				    exceptionWithRequestedSize: 2 *
								sizeof(*ret)];
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199

			ret[0] = tmp;
			ret[1] = NULL;

			return ret;
		}

		if ((he = gethostbyname([host UTF8String])) == NULL ||
		    he->h_addrtype != AF_INET)
			@throw [OFAddressTranslationFailedException
			    exceptionWithHost: host
					error: h_errno];

		count = 0;
		for (ip = he->h_addr_list; *ip != NULL; ip++)
			count++;







|
|







185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200

			ret[0] = tmp;
			ret[1] = NULL;

			return ret;
		}

		if ((he = gethostbyname((const void *)[host UTF8String])) ==
		    NULL || he->h_addrtype != AF_INET)
			@throw [OFAddressTranslationFailedException
			    exceptionWithHost: host
					error: h_errno];

		count = 0;
		for (ip = he->h_addr_list; *ip != NULL; ip++)
			count++;