ObjXMPP  Check-in [21295ecf12]

Overview
Comment:Adjust to recent ObjFW changes.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 21295ecf12cb238f27cda25424d42b55b7824fa93d0e5d538c99a7b1151aa9ed
User & Date: florob@babelmonkeys.de on 2013-01-03 21:27:26
Other Links: manifest | tags
Context
2013-01-03
22:02
Make various XMPPConnection setter accept nil check-in: 7ce8dba65c user: florob@babelmonkeys.de tags: trunk
21:27
Adjust to recent ObjFW changes. check-in: 21295ecf12 user: florob@babelmonkeys.de tags: trunk
2012-12-22
16:41
Adjust to recent ObjFW changes. check-in: fcef8e0b54 user: js tags: trunk
Changes

Modified src/XMPPSRVLookup.m from [17ba4973e1] to [3faae45dc8].

192
193
194
195
196
197
198

199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214

215
216
217

218
219
220
221
222
223

224
225
226
227
228
229
230
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214

215
216
217

218
219
220
221
222
223

224
225
226
227
228
229
230
231







+















-
+


-
+





-
+







	OF_GETTER(domain, YES)
}

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

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

	@try {
		int answerLen, resourceRecordCount, i;
		ns_rr resourceRecord;
		ns_msg handle;

		if (res_ninit(&resState))
			@throw [OFAddressTranslationFailedException
			    exceptionWithClass: [self class]
					socket: nil
					  host: domain];

		answer = [self allocMemoryWithSize: of_pagesize];
		answer = [self allocMemoryWithSize: pageSize];
		answerLen = res_nsearch(&resState,
		    [request cStringUsingEncoding: OF_STRING_ENCODING_NATIVE],
		    ns_c_in, ns_t_srv, answer, (int)of_pagesize);
		    ns_c_in, ns_t_srv, answer, (int)pageSize);

		if ((answerLen == -1) && ((h_errno == HOST_NOT_FOUND) ||
		    (h_errno == NO_DATA)))
			return;

		if (answerLen < 1 || answerLen > of_pagesize) {
		if (answerLen < 1 || answerLen > pageSize) {
			@throw [OFAddressTranslationFailedException
			    exceptionWithClass: [self class]
					socket: nil
					  host: domain];
		}

		if (ns_initparse(answer, answerLen, &handle))