Shut down when server pushes compression enabled
This commit is contained in:
parent
367e8b7e08
commit
3aadaf0186
@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
### Added
|
### Added
|
||||||
|
|
||||||
- Override DNS servers client side. [#56](https://github.com/keeshux/tunnelkit/pull/56)
|
- Override DNS servers client side. [#56](https://github.com/keeshux/tunnelkit/pull/56)
|
||||||
|
- Shut down if server pushes a compression directive.
|
||||||
|
|
||||||
### Changed
|
### Changed
|
||||||
|
|
||||||
|
@ -70,6 +70,9 @@ public enum SessionError: String, Error {
|
|||||||
|
|
||||||
/// The session reached a stale state and can't be recovered.
|
/// The session reached a stale state and can't be recovered.
|
||||||
case staleSession
|
case staleSession
|
||||||
|
|
||||||
|
/// Server uses compression.
|
||||||
|
case serverCompression
|
||||||
}
|
}
|
||||||
|
|
||||||
extension Error {
|
extension Error {
|
||||||
|
@ -905,6 +905,11 @@ 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, reply.usesCompression {
|
||||||
|
log.error("Server has compression enabled and this is currently unsupported (\(framing))")
|
||||||
|
throw SessionError.serverCompression
|
||||||
|
}
|
||||||
} catch let e {
|
} catch let e {
|
||||||
deferStop(.shutdown, e)
|
deferStop(.shutdown, e)
|
||||||
return
|
return
|
||||||
|
Loading…
Reference in New Issue
Block a user