ObjXMPP  Check-in [1b319603af]

Overview
Comment:Fix completely broken exception handling in -[connect].
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 1b319603afb9509a5998655ba9645d8e93c02eb120547cf99e6b95f4568d0626
User & Date: js on 2011-05-24 10:27:21
Other Links: manifest | tags
Context
2011-05-25
22:03
Ignore whitespace elements. check-in: d0ff4e326d user: js tags: trunk
2011-05-24
10:27
Fix completely broken exception handling in -[connect]. check-in: 1b319603af user: js tags: trunk
10:25
Link against libresolv in .xcodeproj. check-in: 7aa0cdb5e3 user: js tags: trunk
Changes

Modified src/XMPPConnection.m from [ad06d62613] to [56c6a8e995].

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
	return [[password copy] autorelease];
}

- (void)connect
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	XMPPSRVEnumerator *SRVEnumerator =
		[XMPPSRVEnumerator enumeratorWithDomain: server];
	XMPPSRVEntry *candidate;

	while ((candidate = [SRVEnumerator nextObject])) {
		@try {
			[sock connectToHost: [candidate target]
				     onPort: [candidate port]];
			break;
		} @catch (id e) {
			if (([e class] == [OFAddressTranslationFailedException
					class]) || ([e class] ==
					[OFConnectionFailedException class]))
				continue;
			else
				@throw e;
		}
	}

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

	[self XMPP_startStream];

	[pool release];
}

- (void)handleConnection
{







|


|




<
|
|
|
<
|
<


>



>







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
	return [[password copy] autorelease];
}

- (void)connect
{
	OFAutoreleasePool *pool = [[OFAutoreleasePool alloc] init];
	XMPPSRVEnumerator *SRVEnumerator =
	    [XMPPSRVEnumerator enumeratorWithDomain: server];
	XMPPSRVEntry *candidate;

	while ((candidate = [SRVEnumerator nextObject]) != nil) {
		@try {
			[sock connectToHost: [candidate target]
				     onPort: [candidate port]];
			break;

		} @catch (OFAddressTranslationFailedException *e) {
			[e release];
		} @catch (OFConnectionFailedException *e) {

			[e release];

		}
	}

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

	[self XMPP_startStream];

	[pool release];
}

- (void)handleConnection
{