ObjFW  Diff

Differences From Artifact [7b6a248246]:

To Artifact [b23751c527]:


122
123
124
125
126
127
128
129

130



131
132








133
134
135


136
137
138
139
140











141
142
143
144
145
146
147
122
123
124
125
126
127
128

129
130
131
132
133


134
135
136
137
138
139
140
141
142


143
144
145




146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163







-
+

+
+
+
-
-
+
+
+
+
+
+
+
+

-
-
+
+

-
-
-
-
+
+
+
+
+
+
+
+
+
+
+







# endif
		@throw [OFAddressTranslationFailedException
		    newWithClass: isa
			    node: node
			 service: service];
	}

	if ((se = getservbyname([service cString], "TCP")) != NULL)
	if ((se = getservbyname([service cString], "tcp")) != NULL)
		port = se->s_port;
	else {
		@try {
			intmax_t p = [service decimalValue];
	else if ((port = of_bswap16_if_le(strtol([service cString], NULL,
	    10))) == 0) {

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

			port = of_bswap16_if_le(p);
		} @catch (OFInvalidFormatException *e) {
			[e release];
# ifdef OF_THREADS
		[addrlist release];
		[mutex unlock];
			[addrlist release];
			[mutex unlock];
# endif
		@throw [OFAddressTranslationFailedException
		    newWithClass: isa
			    node: node
			 service: service];
			@throw [OFAddressTranslationFailedException
			    newWithClass: isa
				    node: node
				 service: service];
		} @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 ||
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
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
293
294
295
296
297
298
299
300
301
302
303
304







-
+

+
+
+
-
-
+
+
+
+
+
+
+
+

-
+

-
-
-
-
+
+
+
+
+
+
+
+
+
+







# endif
		@throw [OFAddressTranslationFailedException
		    newWithClass: isa
			    node: node
			 service: service];
	}

	if ((se = getservbyname([service cString], "TCP")) != NULL)
	if ((se = getservbyname([service cString], "tcp")) != NULL)
		port = se->s_port;
	else {
		@try {
			intmax_t p = [service decimalValue];
	else if ((port = of_bswap16_if_le(strtol([service cString], NULL,
	    10))) == 0) {

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

			port = of_bswap16_if_le(p);
		} @catch (OFInvalidFormatException *e) {
			[e release];
# ifdef OF_THREADS
		[mutex unlock];
			[mutex unlock];
# endif
		@throw [OFAddressTranslationFailedException
		    newWithClass: isa
			    node: node
			 service: service];
			@throw [OFAddressTranslationFailedException
			    newWithClass: isa
				    node: node
				 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) {