ObjXMPP  Diff

Differences From Artifact [c9e6b14c30]:

To Artifact [c4d409163f]:


293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323

	[_socket asyncConnectToHost: record.target
			       port: record.port];
}

-	(void)resolver: (OFDNSResolver *)resolver
  didResolveDomainName: (OFString *)domainName
	 answerRecords: (OFDictionary *)answerRecords
      authorityRecords: (OFDictionary *)authorityRecords
     additionalRecords: (OFDictionary *)additionalRecords
	     exception: (id)exception
{
	OFMutableArray *records = [OFMutableArray array];

	if (exception != nil) {
		[_delegates
		    broadcastSelector: @selector(connection:didThrowException:)
			   withObject: self
			   withObject: exception];
		return;
	}

	for (OFDNSResourceRecord *record in
	    [answerRecords objectForKey: domainName])
		if ([record isKindOfClass: [OFSRVDNSResourceRecord class]])
		       [records addObject: record];

	/* TODO: Sort records */
	[records makeImmutable];

	if (records.count == 0) {







|
<
<













|







293
294
295
296
297
298
299
300


301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321

	[_socket asyncConnectToHost: record.target
			       port: record.port];
}

-	(void)resolver: (OFDNSResolver *)resolver
  didResolveDomainName: (OFString *)domainName
	      response: (OFDNSResponse *)response


	     exception: (id)exception
{
	OFMutableArray *records = [OFMutableArray array];

	if (exception != nil) {
		[_delegates
		    broadcastSelector: @selector(connection:didThrowException:)
			   withObject: self
			   withObject: exception];
		return;
	}

	for (OFDNSResourceRecord *record in
	    [response.answerRecords objectForKey: domainName])
		if ([record isKindOfClass: [OFSRVDNSResourceRecord class]])
		       [records addObject: record];

	/* TODO: Sort records */
	[records makeImmutable];

	if (records.count == 0) {
345
346
347
348
349
350
351
352
353
354
355

356
357
358
359
360
361
362
363

	if (_server != nil)
		[_socket asyncConnectToHost: _server
				       port: _port];
	else {
		OFString *SRVDomain = [_domainToASCII
		    stringByPrependingString: @"_xmpp-client._tcp."];
		[[OFThread DNSResolver]
		    asyncResolveHost: SRVDomain
			 recordClass: OF_DNS_RESOURCE_RECORD_CLASS_IN
			  recordType: OF_DNS_RESOURCE_RECORD_TYPE_SRV

			    delegate: self];
	}

	objc_autoreleasePoolPop(pool);
}

-  (bool)xmpp_parseBuffer: (const void *)buffer
		   length: (size_t)length







|
|

|
>
|







343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362

	if (_server != nil)
		[_socket asyncConnectToHost: _server
				       port: _port];
	else {
		OFString *SRVDomain = [_domainToASCII
		    stringByPrependingString: @"_xmpp-client._tcp."];
		OFDNSRequest *request = [OFDNSRequest
		    requestWithHost: SRVDomain
			 recordClass: OF_DNS_RESOURCE_RECORD_CLASS_IN
			  recordType: OF_DNS_RESOURCE_RECORD_TYPE_SRV];
		[[OFThread DNSResolver] asyncPerformRequest: request
						   delegate: self];
	}

	objc_autoreleasePoolPop(pool);
}

-  (bool)xmpp_parseBuffer: (const void *)buffer
		   length: (size_t)length