Accept LZO regardless of framing
This commit is contained in:
parent
9a6f3d638c
commit
4b9ffcfb4e
|
@ -117,7 +117,7 @@
|
||||||
[self.decrypter setPeerId:peerId];
|
[self.decrypter setPeerId:peerId];
|
||||||
[self setCompressionFraming:compressionFraming];
|
[self setCompressionFraming:compressionFraming];
|
||||||
|
|
||||||
if (LZOIsSupported() && (compressionFraming == CompressionFramingNativeCompLZO) && (compressionAlgorithm == CompressionAlgorithmNativeLZO)) {
|
if (LZOIsSupported() && (compressionAlgorithm == CompressionAlgorithmNativeLZO)) {
|
||||||
self.lzo = LZOCreate();
|
self.lzo = LZOCreate();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -912,20 +912,20 @@ public class SessionProxy {
|
||||||
reply = optionalReply
|
reply = optionalReply
|
||||||
log.debug("Received PUSH_REPLY: \"\(reply.maskedDescription)\"")
|
log.debug("Received PUSH_REPLY: \"\(reply.maskedDescription)\"")
|
||||||
|
|
||||||
if let framing = reply.compressionFraming, let compression = reply.compressionAlgorithm, compression != .disabled {
|
if let framing = reply.compressionFraming, let compression = reply.compressionAlgorithm {
|
||||||
switch framing {
|
switch compression {
|
||||||
case .compress:
|
case .disabled:
|
||||||
log.error("Server has new compression enabled and this is currently unsupported (\(framing))")
|
break
|
||||||
throw SessionError.serverCompression
|
|
||||||
|
|
||||||
case .compLZO:
|
case .LZO:
|
||||||
if !LZOIsSupported() {
|
if !LZOIsSupported() {
|
||||||
log.error("Server has legacy LZO compression enabled and this was not built into the library (\(framing))")
|
log.error("Server has LZO compression enabled and this was not built into the library (framing=\(framing))")
|
||||||
throw SessionError.serverCompression
|
throw SessionError.serverCompression
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
case .other:
|
||||||
break
|
log.error("Server has non-LZO compression enabled and this is currently unsupported (framing=\(framing))")
|
||||||
|
throw SessionError.serverCompression
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch let e {
|
} catch let e {
|
||||||
|
|
Loading…
Reference in New Issue