ObjXMPP  Check-in [d6978b56f0]

Overview
Comment:Remove dependency on libresolv
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: d6978b56f0125dc404d9aee11dc4cc8f732891f491fcd9bc939e9681c6149c21
User & Date: js on 2018-11-05 00:14:15
Other Links: manifest | tags
Context
2018-11-05
21:22
Modernize coding style check-in: 180bf3d08b user: js tags: trunk
00:14
Remove dependency on libresolv check-in: d6978b56f0 user: js tags: trunk
2018-11-04
23:01
Fix SCRAM auth check-in: 73157b0bcd user: js tags: trunk
Changes

Modified configure.ac from [4953692245] to [e22c5dc207].

44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
AC_ARG_ENABLE(static, AS_HELP_STRING([--enable-static], [build static library]))
AS_IF([test x"$enable_static" = x"yes" -o x"$enable_shared" = x"no"], [
	AC_PATH_TOOL(AR, ar)
	AC_PROG_RANLIB
	AC_SUBST(OBJXMPP_STATIC_LIB, "libobjxmpp.a")
])

# This is an adapted version of what glib does for res_query
# It should recognize the correct library on (at least) Linux,
# NetBSD, FreeBSD, Mac OS X and Haiku
AC_MSG_CHECKING([for res_nsearch])
AC_TRY_LINK([#include <sys/types.h>
	     #include <netinet/in.h>
	     #include <arpa/nameser.h>
	     #include <resolv.h>],
	     [res_nsearch(&_res, "test", 0, 0, (void *)0, 0);],
	     [AC_MSG_RESULT([yes])],
	     [save_libs="$LIBS"
	      LIBS="$LIBS -lresolv"
	      AC_TRY_LINK([#include <sys/types.h>
			   #include <netinet/in.h>
			   #include <arpa/nameser.h>
			   #include <resolv.h>],
			   [res_nsearch(&_res, "test", 0, 0, (void *)0, 0);],
			   [AC_MSG_RESULT([in -lresolv])],
			   [LIBS="$save_libs -lnetwork"
			    AC_TRY_LINK([#include <sys/types.h>
					 #include <netinet/in.h>
					 #include <arpa/nameser.h>
					 #include <resolv.h>],
					[res_nsearch(&_res, "test", 0, 0, (void *)0, 0);],
					[AC_MSG_RESULT([in -lnetwork])],
					[LIBS="$save_libs -lbind"
					 AC_TRY_LINK([#include <resolv.h>],
						     [res_nsearch(&_res, "test", 0, 0, (void *)0, 0);],
						     [AC_MSG_RESULT([in -lbind])],
						     [AC_MSG_ERROR(not found)])])])])

AC_MSG_CHECKING([for res_ndestroy])
AC_TRY_LINK([
	#include <resolv.h>
], [
	res_ndestroy(&_res)
], [
	AC_MSG_RESULT(yes)
	AC_DEFINE(HAVE_RES_NDESTROY, 1, [Whether we have res_ndestroy])
], [
	AC_MSG_RESULT(no)
])

AC_CHECK_LIB(objopenssl, main, [
	AC_SUBST(OBJOPENSSL_LIBS, "-lobjopenssl -lcrypto")
	AC_SUBST(OBJOPENSSL_FRAMEWORK_LIBS, "-framework ObjOpenSSL -lcrypto")
], [
	AC_MSG_ERROR(You need ObjOpenSSL installed!)
])








<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







44
45
46
47
48
49
50











































51
52
53
54
55
56
57
AC_ARG_ENABLE(static, AS_HELP_STRING([--enable-static], [build static library]))
AS_IF([test x"$enable_static" = x"yes" -o x"$enable_shared" = x"no"], [
	AC_PATH_TOOL(AR, ar)
	AC_PROG_RANLIB
	AC_SUBST(OBJXMPP_STATIC_LIB, "libobjxmpp.a")
])












































AC_CHECK_LIB(objopenssl, main, [
	AC_SUBST(OBJOPENSSL_LIBS, "-lobjopenssl -lcrypto")
	AC_SUBST(OBJOPENSSL_FRAMEWORK_LIBS, "-framework ObjOpenSSL -lcrypto")
], [
	AC_MSG_ERROR(You need ObjOpenSSL installed!)
])

Modified src/Makefile from [35d31a672d] to [c878fa6e9c].

22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
       XMPPMessage.m		\
       XMPPMulticastDelegate.m	\
       XMPPPLAINAuth.m		\
       XMPPPresence.m		\
       XMPPRoster.m		\
       XMPPRosterItem.m		\
       XMPPSCRAMAuth.m		\
       XMPPSRVLookup.m		\
       XMPPStanza.m		\
       XMPPStreamManagement.m	\
       XMPPXMLElementBuilder.m

INCLUDES = ${SRCS:.m=.h}	\
	   namespaces.h		\
	   ObjXMPP.h		\







<







22
23
24
25
26
27
28

29
30
31
32
33
34
35
       XMPPMessage.m		\
       XMPPMulticastDelegate.m	\
       XMPPPLAINAuth.m		\
       XMPPPresence.m		\
       XMPPRoster.m		\
       XMPPRosterItem.m		\
       XMPPSCRAMAuth.m		\

       XMPPStanza.m		\
       XMPPStreamManagement.m	\
       XMPPXMLElementBuilder.m

INCLUDES = ${SRCS:.m=.h}	\
	   namespaces.h		\
	   ObjXMPP.h		\

Modified src/XMPPConnection.h from [883bb55bc1] to [abb0306b65].

1
2
3
4
5
6
7
8
9
/*
 * Copyright (c) 2010, 2011, 2012, 2013, 2016
 *   Jonathan Schleifer <js@heap.zone>
 * Copyright (c) 2011, 2012, Florian Zeitz <florob@babelmonkeys.de>
 *
 * https://heap.zone/objxmpp/
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above

|







1
2
3
4
5
6
7
8
9
/*
 * Copyright (c) 2010, 2011, 2012, 2013, 2016, 2017, 2018
 *   Jonathan Schleifer <js@heap.zone>
 * Copyright (c) 2011, 2012, Florian Zeitz <florob@babelmonkeys.de>
 *
 * https://heap.zone/objxmpp/
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
 * @param connection The connection that was closed
 */
- (void)connectionWasClosed: (XMPPConnection *)connection;

/*!
 * @brief This callback is called when the connection threw an exception.
 *
 * This is only called for connections on which
 * @ref XMPPConnection::handleConnection has been called.
 *
 * @param connection The connection which threw an exception
 * @param exception The exception the connection threw
 */
-  (void)connection: (XMPPConnection *)connection
  didThrowException: (OFException *)exception;

/*!







<
<
<







112
113
114
115
116
117
118



119
120
121
122
123
124
125
 * @param connection The connection that was closed
 */
- (void)connectionWasClosed: (XMPPConnection *)connection;

/*!
 * @brief This callback is called when the connection threw an exception.
 *



 * @param connection The connection which threw an exception
 * @param exception The exception the connection threw
 */
-  (void)connection: (XMPPConnection *)connection
  didThrowException: (OFException *)exception;

/*!
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
305
306
307
308
309
310
311
312
313
/*!
 * @brief Removes the specified delegate.
 *
 * @param delegate The delegate to remove
 */
- (void)removeDelegate: (id <XMPPConnectionDelegate>)delegate;

/*!
 * @brief Connects to the XMPP service.
 */
- (void)connect;

/*!
 * @brief Closes the stream to the XMPP service
 */
- (void)close;

/*!
 * @brief Checks the certificate presented by the server and sets the specified
 *	  pointer to the reason why the certificate is not valid
 *
 * @param reason A pointer to an OFString which is set to a reason in case the
 *		 certificate is not valid (otherwise, it does not touch it).
 *		 Passing NULL means the reason is not stored anywhere.
 * @return Whether the certificate is valid
 */
- (bool)checkCertificateAndGetReason:
    (OFString *__autoreleasing _Nonnull *_Nullable)reason;

/*!
 * @brief Adds the connection to the run loop.
 */
- (void)handleConnection;

/*!
 * @brief Asynchronously connects to the server and adds the connection to the
 *	  run loop.
 */
- (void)asyncConnectAndHandle;

/*!
 * @brief Parses the specified buffer.
 *
 * This is useful for handling multiple connections at once.
 *
 * @param buffer The buffer to parse







<
<
<
<
<


















<
<
<
<
<
|
<

|







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
/*!
 * @brief Removes the specified delegate.
 *
 * @param delegate The delegate to remove
 */
- (void)removeDelegate: (id <XMPPConnectionDelegate>)delegate;






/*!
 * @brief Closes the stream to the XMPP service
 */
- (void)close;

/*!
 * @brief Checks the certificate presented by the server and sets the specified
 *	  pointer to the reason why the certificate is not valid
 *
 * @param reason A pointer to an OFString which is set to a reason in case the
 *		 certificate is not valid (otherwise, it does not touch it).
 *		 Passing NULL means the reason is not stored anywhere.
 * @return Whether the certificate is valid
 */
- (bool)checkCertificateAndGetReason:
    (OFString *__autoreleasing _Nonnull *_Nullable)reason;

/*!





 * @brief Asynchronously connects to the server.

 */
- (void)asyncConnect;

/*!
 * @brief Parses the specified buffer.
 *
 * This is useful for handling multiple connections at once.
 *
 * @param buffer The buffer to parse

Modified src/XMPPConnection.m from [224a0258a2] to [9754b2ecb4].

1
2
3
4
5
6
7
8
9
/*
 * Copyright (c) 2010, 2011, 2012, 2013, 2015, 2016
 *   Jonathan Schleifer <js@heap.zone>
 * Copyright (c) 2011, 2012, Florian Zeitz <florob@babelmonkeys.de>
 *
 * https://heap.zone/objxmpp/
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above

|







1
2
3
4
5
6
7
8
9
/*
 * Copyright (c) 2010, 2011, 2012, 2013, 2015, 2016, 2017, 2018
 *   Jonathan Schleifer <js@heap.zone>
 * Copyright (c) 2011, 2012, Florian Zeitz <florob@babelmonkeys.de>
 *
 * https://heap.zone/objxmpp/
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#import <ObjOpenSSL/SSLInvalidCertificateException.h>
#import <ObjOpenSSL/X509Certificate.h>

#import <ObjFW/OFInvalidArgumentException.h>

#import "XMPPConnection.h"
#import "XMPPCallback.h"
#import "XMPPSRVLookup.h"
#import "XMPPEXTERNALAuth.h"
#import "XMPPSCRAMAuth.h"
#import "XMPPPLAINAuth.h"
#import "XMPPStanza.h"
#import "XMPPJID.h"
#import "XMPPIQ.h"
#import "XMPPMessage.h"







<







37
38
39
40
41
42
43

44
45
46
47
48
49
50
#import <ObjOpenSSL/SSLInvalidCertificateException.h>
#import <ObjOpenSSL/X509Certificate.h>

#import <ObjFW/OFInvalidArgumentException.h>

#import "XMPPConnection.h"
#import "XMPPCallback.h"

#import "XMPPEXTERNALAuth.h"
#import "XMPPSCRAMAuth.h"
#import "XMPPPLAINAuth.h"
#import "XMPPStanza.h"
#import "XMPPJID.h"
#import "XMPPIQ.h"
#import "XMPPMessage.h"
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
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
- (void)XMPP_sendSession;
- (void)XMPP_handleSessionForConnection: (XMPPConnection *)connection
				     IQ: (XMPPIQ *)IQ;
- (OFString *)XMPP_IDNAToASCII: (OFString *)domain;
- (XMPPMulticastDelegate *)XMPP_delegates;
@end

@interface XMPPConnection_ConnectThread: OFThread
{
	OFThread *_sourceThread;
	XMPPConnection *_connection;
}

- initWithSourceThread: (OFThread *)sourceThread
	    connection: (XMPPConnection *)connection;
@end

OF_ASSUME_NONNULL_END

@implementation XMPPConnection_ConnectThread
- initWithSourceThread: (OFThread *)sourceThread
	    connection: (XMPPConnection *)connection
{
	self = [super init];

	@try {
		_sourceThread = [sourceThread retain];
		_connection = [connection retain];
	} @catch (id e) {
		[self release];
		@throw e;
	}

	return self;
}

- (void)dealloc
{
	[_sourceThread release];
	[_connection release];

	[super dealloc];
}

- (void)didConnect
{
	[self join];

	[_connection handleConnection];
}

- (id)main
{
	void *pool = objc_autoreleasePoolPush();

	[_connection connect];

	[self performSelector: @selector(didConnect)
		     onThread: _sourceThread
		waitUntilDone: false];

	objc_autoreleasePoolPop(pool);

	return nil;
}
@end

@implementation XMPPConnection
@synthesize username = _username, resource = _resource, server = _server;
@synthesize domain = _domain, password = _password, language = _language;
@synthesize privateKeyFile = _privateKeyFile;
@synthesize certificateFile = _certificateFile, socket = _socket;
@synthesize encryptionRequired = _encryptionRequired, encrypted = _encrypted;
@synthesize supportsRosterVersioning = _supportsRosterVersioning;







<
<
<
<
<
<
<
<
<
<


<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<







79
80
81
82
83
84
85










86
87
















































88
89
90
91
92
93
94
- (void)XMPP_sendSession;
- (void)XMPP_handleSessionForConnection: (XMPPConnection *)connection
				     IQ: (XMPPIQ *)IQ;
- (OFString *)XMPP_IDNAToASCII: (OFString *)domain;
- (XMPPMulticastDelegate *)XMPP_delegates;
@end











OF_ASSUME_NONNULL_END

















































@implementation XMPPConnection
@synthesize username = _username, resource = _resource, server = _server;
@synthesize domain = _domain, password = _password, language = _language;
@synthesize privateKeyFile = _privateKeyFile;
@synthesize certificateFile = _certificateFile, socket = _socket;
@synthesize encryptionRequired = _encryptionRequired, encrypted = _encrypted;
@synthesize supportsRosterVersioning = _supportsRosterVersioning;
312
313
314
315
316
317
318























































































319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373


374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
		}
	} else
		_password = nil;

	[old release];
}
























































































- (void)connect
{
	void *pool = objc_autoreleasePoolPush();
	XMPPSRVEntry *candidate = nil;
	XMPPSRVLookup *SRVLookup = nil;
	OFEnumerator *enumerator;

	if (_socket != nil)
		@throw [OFAlreadyConnectedException exception];

	_socket = [[OFTCPSocket alloc] init];

	if (_server)
		[_socket connectToHost: _server
				  port: _port];
	else {
		@try {
			SRVLookup = [XMPPSRVLookup
			    lookupWithDomain: _domainToASCII];
		} @catch (id e) {
		}

		enumerator = [SRVLookup objectEnumerator];

		/* Iterate over SRV records, if any */
		if ((candidate = [enumerator nextObject]) != nil) {
			do {
				@try {
					[_socket
					    connectToHost: [candidate target]
						     port: [candidate port]];
					break;
				} @catch (OFResolveHostFailedException *e) {
				} @catch (OFConnectionFailedException *e) {
				}
			} while ((candidate = [enumerator nextObject]) != nil);
		} else
			/* No SRV records -> fall back to A / AAAA record */
			[_socket connectToHost: _domainToASCII
					  port: _port];
	}

	[self XMPP_startStream];

	objc_autoreleasePoolPop(pool);
}

- (void)handleConnection
{
	char *buffer = [self allocMemoryWithSize: BUFFER_LENGTH];

	[_socket asyncReadIntoBuffer: buffer
			      length: BUFFER_LENGTH
			      target: self
			    selector: @selector(stream:didReadIntoBuffer:length:


					  exception:)
			     context: nil];
}

- (void)asyncConnectAndHandle
{
	void *pool = objc_autoreleasePoolPush();

	[[[[XMPPConnection_ConnectThread alloc]
	    initWithSourceThread: [OFThread currentThread]
		      connection: self] autorelease] start];

	objc_autoreleasePoolPop(pool);
}

-  (bool)XMPP_parseBuffer: (const void *)buffer
		   length: (size_t)length
{







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
|


<
<
<






|
|
|
|
<
<
<
<
<
|
<
|
<
<
<
<
<
<
|
<
<
<
<
<
|
<
<
<
<
|
<
|
<
<
<
<
<
<
<
<
<

|
>
>
|
|
<
<
<
<
<
<
<
<
<







253
254
255
256
257
258
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
289
290
291
292
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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349



350
351
352
353
354
355
356
357
358
359





360

361






362





363




364

365









366
367
368
369
370
371









372
373
374
375
376
377
378
		}
	} else
		_password = nil;

	[old release];
}

- (void)XMPP_socketDidConnect: (OFTCPSocket *)socket
		      context: (OFArray *)nextSRVRecords
		    exception: (id)exception
{
	char *buffer;

	if (exception != nil) {
		if (nextSRVRecords != nil) {
			[self XMPP_tryNextSRVRecord: nextSRVRecords];
			return;
		}

		[_delegates
		    broadcastSelector: @selector(connection:didThrowException:)
			   withObject: self
			   withObject: exception];
		return;
	}

	[self XMPP_startStream];

	buffer = [self allocMemoryWithSize: BUFFER_LENGTH];
	[_socket asyncReadIntoBuffer: buffer
			      length: BUFFER_LENGTH
			      target: self
			    selector: @selector(XMPP_stream:didReadIntoBuffer:
					  length:exception:)
			     context: nil];
}

- (void)XMPP_tryNextSRVRecord: (OFArray *)SRVRecords
{
	OFSRVDNSResourceRecord *record = [SRVRecords objectAtIndex: 0];

	SRVRecords = [SRVRecords objectsInRange:
	    of_range(1, [SRVRecords count] - 1)];
	if ([SRVRecords count] == 0)
		SRVRecords = nil;

	[_socket asyncConnectToHost: [record target]
			       port: [record port]
			     target: self
			   selector: @selector(XMPP_socketDidConnect:
					 context:exception:)
			    context: SRVRecords];
}

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

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

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

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

	if ([records count] == 0) {
		/* Fall back to A / AAA record. */
		[_socket asyncConnectToHost: domainToASCII
				       port: _port
				     target: self
				   selector: @selector(XMPP_socketDidConnect:
						 context:exception:)
				    context: nil];
		return;
	}

	[self XMPP_tryNextSRVRecord: records];
}

- (void)asyncConnect
{
	void *pool = objc_autoreleasePoolPush();




	if (_socket != nil)
		@throw [OFAlreadyConnectedException exception];

	_socket = [[OFTCPSocket alloc] init];

	if (_server != nil)
		[_socket asyncConnectToHost: _server
				       port: _port
				     target: self





				   selector: @selector(XMPP_socketDidConnect:

						 context:exception:)






				    context: nil];





	else




		[[OFThread DNSResolver]

		    asyncResolveHost: _domainToASCII









			      target: self
			    selector: @selector(XMPP_resolver:
					  didResolveDomainName:answerRecords:
					  authorityRecords:additionalRecords:
					  context:exception:)
			     context: _domainToASCII];










	objc_autoreleasePoolPop(pool);
}

-  (bool)XMPP_parseBuffer: (const void *)buffer
		   length: (size_t)length
{
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
	[_oldParser release];
	[_oldElementBuilder release];

	_oldParser = nil;
	_oldElementBuilder = nil;
}

-      (bool)stream: (OFStream *)stream
  didReadIntoBuffer: (char *)buffer
	     length: (size_t)length
	  exception: (OFException *)exception
{
	if (exception != nil) {
		[_delegates broadcastSelector: @selector(connection:
						   didThrowException:)







|







404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
	[_oldParser release];
	[_oldElementBuilder release];

	_oldParser = nil;
	_oldElementBuilder = nil;
}

- (bool)XMPP_stream: (OFStream *)stream
  didReadIntoBuffer: (char *)buffer
	     length: (size_t)length
	  exception: (OFException *)exception
{
	if (exception != nil) {
		[_delegates broadcastSelector: @selector(connection:
						   didThrowException:)
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468

		_oldParser = nil;
		_oldElementBuilder = nil;

		[_socket asyncReadIntoBuffer: buffer
				      length: BUFFER_LENGTH
				      target: self
				    selector: @selector(stream:
						  didReadIntoBuffer:length:
						  exception:)
				     context: nil];

		return false;
	}








|







441
442
443
444
445
446
447
448
449
450
451
452
453
454
455

		_oldParser = nil;
		_oldElementBuilder = nil;

		[_socket asyncReadIntoBuffer: buffer
				      length: BUFFER_LENGTH
				      target: self
				    selector: @selector(XMPP_stream:
						  didReadIntoBuffer:length:
						  exception:)
				     context: nil];

		return false;
	}

923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
		/* Stream restart */
		[self XMPP_startStream];

		return;
	}

	if ([[element name] isEqual: @"failure"]) {
		of_log(@"Auth failed!");
		// FIXME: Do more parsing/handling
		@throw [XMPPAuthFailedException
		    exceptionWithConnection: self
				     reason: [element XMLString]];
	}

	assert(0);
}







<
|







910
911
912
913
914
915
916

917
918
919
920
921
922
923
924
		/* Stream restart */
		[self XMPP_startStream];

		return;
	}

	if ([[element name] isEqual: @"failure"]) {

		/* FIXME: Do more parsing/handling */
		@throw [XMPPAuthFailedException
		    exceptionWithConnection: self
				     reason: [element XMLString]];
	}

	assert(0);
}

Deleted src/XMPPSRVLookup.h version [72a7f4de73].

Deleted src/XMPPSRVLookup.m version [bed03f8f6f].

Modified tests/test.m from [a93ba6280b] to [654249e42f].

122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
	}

	[conn setDomain: [arguments objectAtIndex: 0]];
	[conn setUsername: [arguments objectAtIndex: 1]];
	[conn setPassword: [arguments objectAtIndex: 2]];
	[conn setResource: @"ObjXMPP"];

	[conn asyncConnectAndHandle];
}

-  (void)connection: (XMPPConnection *)conn
  didReceiveElement: (OFXMLElement *)element
{
	of_log(@"In:  %@", element);
}







|







122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
	}

	[conn setDomain: [arguments objectAtIndex: 0]];
	[conn setUsername: [arguments objectAtIndex: 1]];
	[conn setPassword: [arguments objectAtIndex: 2]];
	[conn setResource: @"ObjXMPP"];

	[conn asyncConnect];
}

-  (void)connection: (XMPPConnection *)conn
  didReceiveElement: (OFXMLElement *)element
{
	of_log(@"In:  %@", element);
}