tweaks
This commit is contained in:
parent
2453f33191
commit
a6f68e7b70
@ -430,7 +430,7 @@ public final class SocketEngine: NSObject, WebSocketDelegate, SocketLogClient {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for var i = 0, l = str.length; i < l; i = i &+ 1 {
|
for var i = 0, l = str.length; i < l; i++ {
|
||||||
let chr = String(strArray[i])
|
let chr = String(strArray[i])
|
||||||
|
|
||||||
if chr != ":" {
|
if chr != ":" {
|
||||||
@ -443,7 +443,7 @@ public final class SocketEngine: NSObject, WebSocketDelegate, SocketLogClient {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
msg = String(strArray[i&+1...i&+n])
|
msg = String(strArray[i+1...i+n])
|
||||||
|
|
||||||
if let lengthInt = length.toInt() {
|
if let lengthInt = length.toInt() {
|
||||||
if lengthInt != msg.length {
|
if lengthInt != msg.length {
|
||||||
|
|||||||
@ -27,7 +27,6 @@ import Foundation
|
|||||||
|
|
||||||
@objc public protocol SocketEngineClient {
|
@objc public protocol SocketEngineClient {
|
||||||
var handleQueue:dispatch_queue_attr_t! {get}
|
var handleQueue:dispatch_queue_attr_t! {get}
|
||||||
var emitQueue:dispatch_queue_attr_t! {get}
|
|
||||||
var socketURL:String {get}
|
var socketURL:String {get}
|
||||||
var secure:Bool {get}
|
var secure:Bool {get}
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,6 @@
|
|||||||
import Foundation
|
import Foundation
|
||||||
|
|
||||||
private func emitAckCallback(socket:SocketIOClient, num:Int)
|
private func emitAckCallback(socket:SocketIOClient, num:Int)
|
||||||
// Curried
|
|
||||||
(items:AnyObject...) -> Void {
|
(items:AnyObject...) -> Void {
|
||||||
socket.emitAck(num, withData: items)
|
socket.emitAck(num, withData: items)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -145,7 +145,7 @@ class SocketParser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ++i < arr.count {
|
if ++i < arr.count {
|
||||||
let d = String(arr[i...arr.count-1])
|
let d = str[advance(str.startIndex, i)...advance(str.startIndex, count(str)-1)]
|
||||||
let noPlaceholders = d["(\\{\"_placeholder\":true,\"num\":(\\d*)\\})"] ~= "\"~~$2\""
|
let noPlaceholders = d["(\\{\"_placeholder\":true,\"num\":(\\d*)\\})"] ~= "\"~~$2\""
|
||||||
let data = SocketParser.parseData(noPlaceholders) as? [AnyObject] ?? [noPlaceholders]
|
let data = SocketParser.parseData(noPlaceholders) as? [AnyObject] ?? [noPlaceholders]
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user