ObjXMPP  Check-in [b570a39e78]

Overview
Comment:Adjust to API change.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b570a39e784915f3f742bdb312799163b0d5bee11e5cfa3056de49a76b0200b4
User & Date: js on 2011-06-05 20:07:51
Other Links: manifest | tags
Context
2011-06-16
18:26
Catch the case where the domain exists, but SRV records don't check-in: dad0ddb2c0 user: florob@babelmonkeys.de tags: trunk
2011-06-05
20:07
Adjust to API change. check-in: b570a39e78 user: js tags: trunk
2011-05-27
14:52
Don't throw an exception if SRV records don't exist check-in: 20cf4eff73 user: florob@babelmonkeys.de tags: trunk
Changes

Modified src/XMPPConnection.m from [7679e224b3] to [dc3dcbf9b8].

234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
	OFEnumerator *enumerator;
	OFString *domainToASCII;
	char *cDomainToASCII;
	Idna_rc rc;

	if (server)
		[sock connectToHost: server
			     onPort: port];
	else {
		if ((rc = idna_to_ascii_8z([domain cString], &cDomainToASCII,
		    IDNA_USE_STD3_ASCII_RULES)) != IDNA_SUCCESS)
			@throw [XMPPIDNATranslationFailedException
				newWithClass: isa
				  connection: self
				   operation: @"ToASCII"







|







234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
	OFEnumerator *enumerator;
	OFString *domainToASCII;
	char *cDomainToASCII;
	Idna_rc rc;

	if (server)
		[sock connectToHost: server
			       port: port];
	else {
		if ((rc = idna_to_ascii_8z([domain cString], &cDomainToASCII,
		    IDNA_USE_STD3_ASCII_RULES)) != IDNA_SUCCESS)
			@throw [XMPPIDNATranslationFailedException
				newWithClass: isa
				  connection: self
				   operation: @"ToASCII"
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
			SRVLookup = [XMPPSRVLookup
			    lookupWithDomain: domainToASCII];
			enumerator = [SRVLookup objectEnumerator];

			while ((candidate = [enumerator nextObject]) != nil) {
				@try {
					[sock connectToHost: [candidate target]
						     onPort: [candidate port]];
					break;
				} @catch (OFAddressTranslationFailedException
				    *e) {
					[e release];
				} @catch (OFConnectionFailedException *e) {
					[e release];
				}
			}
		} @catch (OFAddressTranslationFailedException *e) {
			[e release];
		}

		if (!candidate)
			[sock connectToHost: domainToASCII
				     onPort: port];
	}

	[self XMPP_startStream];

	[pool release];
}








|














|







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
			SRVLookup = [XMPPSRVLookup
			    lookupWithDomain: domainToASCII];
			enumerator = [SRVLookup objectEnumerator];

			while ((candidate = [enumerator nextObject]) != nil) {
				@try {
					[sock connectToHost: [candidate target]
						       port: [candidate port]];
					break;
				} @catch (OFAddressTranslationFailedException
				    *e) {
					[e release];
				} @catch (OFConnectionFailedException *e) {
					[e release];
				}
			}
		} @catch (OFAddressTranslationFailedException *e) {
			[e release];
		}

		if (!candidate)
			[sock connectToHost: domainToASCII
				       port: port];
	}

	[self XMPP_startStream];

	[pool release];
}