Clarify comments to explain why we did the move

This commit is contained in:
Erik Little 2018-06-07 07:15:43 -04:00
parent f7ccf338ad
commit 5fdff65281
No known key found for this signature in database
GPG Key ID: 62F837E56F4E9320
2 changed files with 4 additions and 5 deletions

View File

@ -359,7 +359,6 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
///
/// **You shouldn't call this directly**
open func doFastUpgrade() {
if waitingForPoll {
DefaultSocketLogger.Logger.error("Outstanding poll when switched to WebSockets," +
"we'll probably disconnect soon. You should report this.", type: SocketEngine.logType)
@ -374,7 +373,8 @@ open class SocketEngine : NSObject, URLSessionDelegate, SocketEnginePollable, So
flushProbeWait()
// Need to flush postWait to socket since it connected successfully
// (moved from flushProbeWait() since it is also called on connected failure)
// moved from flushProbeWait() since it is also called on connected failure, and we don't want to try and send
// packets through WebSockets when WebSockets has failed!
if !postWait.isEmpty {
flushWaitingForPostToWebSocket()
}

View File

@ -168,7 +168,6 @@ open class SocketManager : NSObject, SocketManagerSpec, SocketParsable, SocketDa
DefaultSocketLogger.Logger.log("Adding engine", type: SocketManager.logType)
engine?.engineQueue.sync {
self.engine?.client = nil
// Close old engine so it will not leak because of URLSession if in polling mode