ObjXMPP  Diff

Differences From Artifact [e13fa9dc89]:

To Artifact [d3b6deb6f8]:


178
179
180
181
182
183
184
185

186
187
188
189
190
191
192
178
179
180
181
182
183
184

185
186
187
188
189
190
191
192







-
+







	[_domain release];

	[super dealloc];
}

- (void)XMPP_lookup
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	void *pool = objc_autoreleasePoolPush();
	unsigned char *answer = NULL;
	size_t pageSize = [OFSystemInfo pageSize];
	OFString *request;

	request = [OFString stringWithFormat: @"_xmpp-client._tcp.%@", _domain];

	@try {
231
232
233
234
235
236
237
238

239
240
241
242
243

244
245
246
247
248
249
250
231
232
233
234
235
236
237

238
239
240
241
242

243
244
245
246
247
248
249
250







-
+




-
+







	} @finally {
		[self freeMemory: answer];
#ifdef HAVE_RES_NDESTROY
		res_ndestroy(&_resState);
#endif
	}

	[pool release];
	objc_autoreleasePoolPop(pool);
}

- (void)XMPP_addEntry: (XMPPSRVEntry *)entry
{
	OFAutoreleasePool *pool;
	void *pool = objc_autoreleasePoolPush();
	OFList *subList;
	of_list_object_t *iter;

	/* Look if there already is a list with the priority */
	for (iter = [_list firstListObject]; iter != NULL; iter = iter->next) {
		XMPPSRVEntry *first = [iter->object firstObject];

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
262
263
264
265
266
267
268


269
270
271
272
273
274
275
276
277

278
279
280
281
282
283
284
285







-
-









-
+







		}

		/* We can't have one if the priority is already bigger */
		if ([first priority] > [entry priority])
			break;
	}

	pool = [[OFAutoreleasePool alloc] init];

	subList = [OFList list];
	[subList appendObject: entry];

	if (iter != NULL)
		[_list insertObject: subList
		   beforeListObject: iter];
	else
		[_list appendObject: subList];

	[pool release];
	objc_autoreleasePoolPop(pool);
}

- (OFEnumerator *)objectEnumerator
{
	return [[[XMPPSRVEnumerator alloc] initWithList: _list] autorelease];
}
@end