ObjFW  Diff

Differences From Artifact [b9305562e5]:

To Artifact [1565c3535f]:


101
102
103
104
105
106
107

108

109
110
111
112
113
114
115
		break;
	}

	freeaddrinfo(res0);
#else
	BOOL connected = NO;
	struct hostent *he;

	struct servent *se;

	struct sockaddr_in addr;
	uint16_t port;
	char **ip;
# ifdef OF_THREADS
	OFDataArray *addrlist;

	addrlist = [[OFDataArray alloc] initWithItemSize: sizeof(char**)];







>

>







101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
		break;
	}

	freeaddrinfo(res0);
#else
	BOOL connected = NO;
	struct hostent *he;
# ifndef _PSP
	struct servent *se;
# endif
	struct sockaddr_in addr;
	uint16_t port;
	char **ip;
# ifdef OF_THREADS
	OFDataArray *addrlist;

	addrlist = [[OFDataArray alloc] initWithItemSize: sizeof(char**)];
123
124
125
126
127
128
129

130
131
132

133
134
135
136
137
138
139
# endif
		@throw [OFAddressTranslationFailedException
		    newWithClass: isa
			    node: node
			 service: service];
	}


	if ((se = getservbyname([service cString], "tcp")) != NULL)
		port = se->s_port;
	else {

		@try {
			intmax_t p = [service decimalValue];

			if (p < 1 || p > 65535)
				@throw [OFOutOfRangeException
				    newWithClass: isa];








>



>







125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
# endif
		@throw [OFAddressTranslationFailedException
		    newWithClass: isa
			    node: node
			 service: service];
	}

# ifndef _PSP
	if ((se = getservbyname([service cString], "tcp")) != NULL)
		port = se->s_port;
	else {
# endif
		@try {
			intmax_t p = [service decimalValue];

			if (p < 1 || p > 65535)
				@throw [OFOutOfRangeException
				    newWithClass: isa];

151
152
153
154
155
156
157

158

159
160
161
162
163
164
165
		} @catch (id e) {
# ifdef OF_THREADS
			[addrlist release];
			[mutex unlock];
# endif
			@throw e;
		}

	}


	memset(&addr, 0, sizeof(addr));
	addr.sin_family = AF_INET;
	addr.sin_port = port;

	if (he->h_addrtype != AF_INET ||
	    (sock = socket(AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) {







>

>







155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
		} @catch (id e) {
# ifdef OF_THREADS
			[addrlist release];
			[mutex unlock];
# endif
			@throw e;
		}
# ifndef _PSP
	}
# endif

	memset(&addr, 0, sizeof(addr));
	addr.sin_family = AF_INET;
	addr.sin_port = port;

	if (he->h_addrtype != AF_INET ||
	    (sock = socket(AF_INET, SOCK_STREAM, 0)) == INVALID_SOCKET) {
248
249
250
251
252
253
254

255

256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272

273
274
275

276
277
278
279
280
281
282
						      node: node
						   service: service];
	}

	freeaddrinfo(res);
#else
	struct hostent *he;

	struct servent *se;

	struct sockaddr_in addr;
	uint16_t port;

# ifdef OF_THREADS
	[mutex lock];
# endif

	if ((he = gethostbyname([node cString])) == NULL) {
# ifdef OF_THREADS
		[mutex unlock];
# endif
		@throw [OFAddressTranslationFailedException
		    newWithClass: isa
			    node: node
			 service: service];
	}


	if ((se = getservbyname([service cString], "tcp")) != NULL)
		port = se->s_port;
	else {

		@try {
			intmax_t p = [service decimalValue];

			if (p < 1 || p > 65535)
				@throw [OFOutOfRangeException
				    newWithClass: isa];








>

>

















>



>







254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
						      node: node
						   service: service];
	}

	freeaddrinfo(res);
#else
	struct hostent *he;
# ifndef _PSP
	struct servent *se;
# endif
	struct sockaddr_in addr;
	uint16_t port;

# ifdef OF_THREADS
	[mutex lock];
# endif

	if ((he = gethostbyname([node cString])) == NULL) {
# ifdef OF_THREADS
		[mutex unlock];
# endif
		@throw [OFAddressTranslationFailedException
		    newWithClass: isa
			    node: node
			 service: service];
	}

# ifndef _PSP
	if ((se = getservbyname([service cString], "tcp")) != NULL)
		port = se->s_port;
	else {
# endif
		@try {
			intmax_t p = [service decimalValue];

			if (p < 1 || p > 65535)
				@throw [OFOutOfRangeException
				    newWithClass: isa];

292
293
294
295
296
297
298

299

300
301
302
303
304
305
306
				 service: service];
		} @catch (id e) {
# ifdef OF_THREADS
			[mutex unlock];
# endif
			@throw e;
		}

	}


	memset(&addr, 0, sizeof(addr));
	addr.sin_family = AF_INET;
	addr.sin_port = port;

	if (he->h_addrtype != AF_INET || he->h_addr_list[0] == NULL) {
# ifdef OF_THREADS







>

>







302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
				 service: service];
		} @catch (id e) {
# ifdef OF_THREADS
			[mutex unlock];
# endif
			@throw e;
		}
# ifndef _PSP
	}
# endif

	memset(&addr, 0, sizeof(addr));
	addr.sin_family = AF_INET;
	addr.sin_port = port;

	if (he->h_addrtype != AF_INET || he->h_addr_list[0] == NULL) {
# ifdef OF_THREADS