commit fix for binary

This commit is contained in:
Erik 2015-04-08 21:51:11 -04:00
parent 14487a1beb
commit 076bbfc782
2 changed files with 5 additions and 9 deletions

View File

@ -83,11 +83,11 @@ public class SocketEngine: NSObject, WebSocketDelegate {
case UPGRADE = 5 case UPGRADE = 5
case NOOP = 6 case NOOP = 6
init(str:String) { init?(str:String?) {
if let value = str.toInt() { if let value = str?.toInt() {
self = PacketType(rawValue: value)! self = PacketType(rawValue: value)!
} else { } else {
self = PacketType.NOOP return nil
} }
} }
} }
@ -450,7 +450,7 @@ public class SocketEngine: NSObject, WebSocketDelegate {
fixDoubleUTF8(&message) fixDoubleUTF8(&message)
} }
let type = PacketType(str: (message["^(\\d)"].groups()?[1])!) let type = PacketType(str: (message["^(\\d)"].groups()?[1]))
if type == PacketType.MESSAGE { if type == PacketType.MESSAGE {
// Remove message type // Remove message type

View File

@ -183,11 +183,7 @@ class SocketParser {
} }
func checkNSP(nsp:String) -> Bool { func checkNSP(nsp:String) -> Bool {
if nsp == "" && socket.nsp != "/" { return nsp == "" && socket.nsp != "/"
return true
} else {
return false
}
} }
let p = parseString(stringMessage) as SocketPacket! let p = parseString(stringMessage) as SocketPacket!