Skip to content

Commit 2d93c73

Browse files
committed
bypassSession => skipStartSession
1 parent 9dd35c8 commit 2d93c73

File tree

2 files changed

+36
-29
lines changed

2 files changed

+36
-29
lines changed

Core/XMPPStream.h

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -225,13 +225,20 @@ extern const NSTimeInterval XMPPStreamTimeoutNone;
225225
@property (readwrite, strong) id tag;
226226

227227
/**
228-
* Session is a deprecated stream feature now that is usually sent now to handle any needed
229-
* backwards compatibility with server implementations. If set, the stream will not
230-
* send the Session element after Binding.
228+
* RFC 6121 states that starting a session is no longer required.
229+
* To skip this step set skipStartSession to YES.
231230
*
232-
* The default value is NO
231+
* [RFC3921] specified one additional
232+
* precondition: formal establishment of an instant messaging and
233+
* presence session. Implementation and deployment experience has
234+
* shown that this additional step is unnecessary. However, for
235+
* backward compatibility an implementation MAY still offer that
236+
* feature. This enables older software to connect while letting
237+
* newer software save a round trip.
238+
*
239+
* The default value is NO.
233240
**/
234-
@property (readwrite, assign) BOOL bypassSession;
241+
@property (readwrite, assign) BOOL skipStartSession;
235242

236243
#if TARGET_OS_IPHONE
237244

Core/XMPPStream.m

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ @interface XMPPStream ()
109109
UInt16 hostPort;
110110

111111
BOOL autoStartTLS;
112-
BOOL bypassSession;
112+
BOOL skipStartSession;
113113

114114
id <XMPPSASLAuthentication> auth;
115115
NSDate *authenticationDate;
@@ -670,32 +670,32 @@ - (void)setResetByteCountPerConnection:(BOOL)flag
670670
dispatch_async(xmppQueue, block);
671671
}
672672

673-
- (BOOL)bypassSession
673+
- (BOOL)skipStartSession
674674
{
675-
__block BOOL result = NO;
676-
677-
dispatch_block_t block = ^{
678-
result = bypassSession;
679-
};
680-
681-
if (dispatch_get_specific(xmppQueueTag))
682-
block();
683-
else
684-
dispatch_sync(xmppQueue, block);
685-
686-
return result;
675+
__block BOOL result = NO;
676+
677+
dispatch_block_t block = ^{
678+
result = skipStartSession;
679+
};
680+
681+
if (dispatch_get_specific(xmppQueueTag))
682+
block();
683+
else
684+
dispatch_sync(xmppQueue, block);
685+
686+
return result;
687687
}
688688

689-
- (void)setBypassSession:(BOOL)flag
689+
- (void)setSkipStartSession:(BOOL)flag
690690
{
691-
dispatch_block_t block = ^{
692-
bypassSession = flag;
693-
};
694-
695-
if (dispatch_get_specific(xmppQueueTag))
696-
block();
697-
else
698-
dispatch_async(xmppQueue, block);
691+
dispatch_block_t block = ^{
692+
skipStartSession = flag;
693+
};
694+
695+
if (dispatch_get_specific(xmppQueueTag))
696+
block();
697+
else
698+
dispatch_async(xmppQueue, block);
699699
}
700700

701701
#if TARGET_OS_IPHONE
@@ -3517,7 +3517,7 @@ - (void)handleBinding:(NSXMLElement *)response
35173517
// Don't forget about that NSXMLElement bug you reported to apple (xmlns is required or element won't be found)
35183518
NSXMLElement *f_session = [features elementForName:@"session" xmlns:@"urn:ietf:params:xml:ns:xmpp-session"];
35193519

3520-
if (f_session && (![self bypassSession]))
3520+
if (f_session && (![self skipStartSession]))
35213521
{
35223522
NSXMLElement *session = [NSXMLElement elementWithName:@"session"];
35233523
[session setXmlns:@"urn:ietf:params:xml:ns:xmpp-session"];

0 commit comments

Comments
 (0)