Refactor engine. Fix infinite recursion in configuration
This commit is contained in:
parent
4de7a48e87
commit
bd7f94333d
@ -359,8 +359,11 @@ public final class SocketEngine : NSObject, NSURLSessionDelegate, SocketEnginePo
|
|||||||
private func handleOpen(openData: String) {
|
private func handleOpen(openData: String) {
|
||||||
do {
|
do {
|
||||||
let json = try openData.toNSDictionary()
|
let json = try openData.toNSDictionary()
|
||||||
|
guard let sid = json[sid] as? String else {
|
||||||
|
client?.engineDidError("Open packet contained no sid")
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if let sid = json["sid"] as? String {
|
|
||||||
let upgradeWs: Bool
|
let upgradeWs: Bool
|
||||||
|
|
||||||
self.sid = sid
|
self.sid = sid
|
||||||
@ -388,7 +391,6 @@ public final class SocketEngine : NSObject, NSURLSessionDelegate, SocketEnginePo
|
|||||||
}
|
}
|
||||||
|
|
||||||
client?.engineDidOpen("Connect")
|
client?.engineDidOpen("Connect")
|
||||||
}
|
|
||||||
} catch {
|
} catch {
|
||||||
didError("Error parsing open packet")
|
didError("Error parsing open packet")
|
||||||
}
|
}
|
||||||
|
|||||||
@ -97,7 +97,7 @@ public struct SocketIOClientConfiguration : ArrayLiteralConvertible, CollectionT
|
|||||||
|
|
||||||
@warn_unused_result
|
@warn_unused_result
|
||||||
public func prefixThrough(position: Index) -> SubSequence {
|
public func prefixThrough(position: Index) -> SubSequence {
|
||||||
return prefixThrough(position)
|
return backingArray.prefixThrough(position)
|
||||||
}
|
}
|
||||||
|
|
||||||
@warn_unused_result
|
@warn_unused_result
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user