ObjXMPP  Check-in [2fc4d4a103]

Overview
Comment:Make it possible to get exceptions in async mode.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 2fc4d4a103403d2db9bac8d56440443cba418d959b3ef9bd229ea1e7181bef37
User & Date: js on 2012-11-24 00:36:29
Other Links: manifest | tags
Context
2012-12-02
00:15
Fix build dependencies check-in: 6b06622e03 user: florob@babelmonkeys.de tags: trunk
2012-11-24
00:36
Make it possible to get exceptions in async mode. check-in: 2fc4d4a103 user: js tags: trunk
2012-11-21
22:26
configure: Check for buggy -Wcast-align. check-in: 0869fda6d7 user: js tags: trunk
Changes

Modified src/XMPPConnection.h from [ee35dc40be] to [bd3a4d49ca].

112
113
114
115
116
117
118












119
120
121
122
123
124
125
/**
 * \brief This callback is called when the connection was closed.
 *
 * \param connection The connection that was closed
 */
- (void)connectionWasClosed: (XMPPConnection*)connection;













/**
 * \brief This callback is called when the connection is about to upgrade to
 *	  TLS.
 *
 * \param connection The connection that will upgraded to TLS
 */
- (void)connectionWillUpgradeToTLS: (XMPPConnection*)connection;







>
>
>
>
>
>
>
>
>
>
>
>







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
/**
 * \brief This callback is called when the connection was closed.
 *
 * \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 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;

/**
 * \brief This callback is called when the connection is about to upgrade to
 *	  TLS.
 *
 * \param connection The connection that will upgraded to TLS
 */
- (void)connectionWillUpgradeToTLS: (XMPPConnection*)connection;

Modified src/XMPPConnection.m from [4026d94f84] to [edc286114d].

340
341
342
343
344
345
346

















347
348
349
350
351
352
353
354
355
356
357
358
359
360
361

-      (BOOL)stream: (OFStream*)stream
  didReadIntoBuffer: (char*)buffer
	     length: (size_t)length
	  exception: (OFException*)exception
{
	if (exception != nil) {

















		[self close];
		return NO;
	}

	if (![self XMPP_parseBuffer: buffer
			     length: length])
		return NO;

	if (oldParser != nil || oldElementBuilder != nil) {
		[oldParser release];
		[oldElementBuilder release];

		oldParser = nil;
		oldElementBuilder = nil;








>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>




<
<
<
<







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

-      (BOOL)stream: (OFStream*)stream
  didReadIntoBuffer: (char*)buffer
	     length: (size_t)length
	  exception: (OFException*)exception
{
	if (exception != nil) {
		[delegates broadcastSelector: @selector(connection:
						  didThrowException::)
				  withObject: self
				  withObject: exception];
		[self close];
		return NO;
	}

	@try {
		if (![self XMPP_parseBuffer: buffer
				     length: length])
			return NO;
	} @catch (id e) {
		[delegates broadcastSelector: @selector(connection:
						  didThrowException::)
				  withObject: self
				  withObject: e];
		[self close];
		return NO;
	}





	if (oldParser != nil || oldElementBuilder != nil) {
		[oldParser release];
		[oldElementBuilder release];

		oldParser = nil;
		oldElementBuilder = nil;