From e5918d1b0566bb9f60400ae02b744d064d9f46e3 Mon Sep 17 00:00:00 2001 From: Davide De Rosa Date: Fri, 7 Sep 2018 15:11:44 +0200 Subject: [PATCH] Override framing with pushed if available --- TunnelKit/Sources/Core/SessionProxy.swift | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/TunnelKit/Sources/Core/SessionProxy.swift b/TunnelKit/Sources/Core/SessionProxy.swift index 10fb058..c5f9455 100644 --- a/TunnelKit/Sources/Core/SessionProxy.swift +++ b/TunnelKit/Sources/Core/SessionProxy.swift @@ -1031,6 +1031,10 @@ public class SessionProxy { log.debug("Set up encryption") } + let pushedFraming = pushReply.compressionFraming + if let negFraming = pushedFraming { + log.debug("Negotiated compression framing: \(negFraming.rawValue)") + } let pushedCipher = pushReply.cipher if let negCipher = pushedCipher { log.debug("Negotiated cipher: \(negCipher.rawValue)") @@ -1054,7 +1058,7 @@ public class SessionProxy { encrypter: bridge.encrypter(), decrypter: bridge.decrypter(), peerId: pushReply.peerId ?? PacketPeerIdDisabled, - compressionFraming: configuration.compressionFraming.native, + compressionFraming: (pushedFraming ?? configuration.compressionFraming).native, maxPackets: link?.packetBufferSize ?? 200, usesReplayProtection: CoreConfiguration.usesReplayProtection )