Recognize "--compress lzo" option as legal
This commit is contained in:
parent
a06a4fef9b
commit
9a6f3d638c
|
@ -315,11 +315,18 @@ public class ConfigurationParser {
|
||||||
isHandled = true
|
isHandled = true
|
||||||
compressionFraming = .compress
|
compressionFraming = .compress
|
||||||
|
|
||||||
|
if !LZOIsSupported() {
|
||||||
guard $0.isEmpty else {
|
guard $0.isEmpty else {
|
||||||
compressionAlgorithm = .other
|
|
||||||
unsupportedError = .unsupportedConfiguration(option: line)
|
unsupportedError = .unsupportedConfiguration(option: line)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
if let arg = $0.first {
|
||||||
|
compressionAlgorithm = (arg == "lzo") ? .LZO : .other
|
||||||
|
} else {
|
||||||
|
compressionAlgorithm = .disabled
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Regex.keyDirection.enumerateArguments(in: line) {
|
Regex.keyDirection.enumerateArguments(in: line) {
|
||||||
isHandled = true
|
isHandled = true
|
||||||
|
|
|
@ -395,18 +395,20 @@ extension SessionProxy {
|
||||||
switch $0[0] {
|
switch $0[0] {
|
||||||
case "comp-lzo":
|
case "comp-lzo":
|
||||||
compressionFraming = .compLZO
|
compressionFraming = .compLZO
|
||||||
if !(($0.count == 2) && ($0[1] == "no")) {
|
if ($0.count == 2) && ($0[1] == "no") {
|
||||||
compressionAlgorithm = .LZO
|
|
||||||
} else {
|
|
||||||
compressionAlgorithm = .disabled
|
compressionAlgorithm = .disabled
|
||||||
|
} else {
|
||||||
|
compressionAlgorithm = .LZO
|
||||||
}
|
}
|
||||||
|
|
||||||
case "compress":
|
case "compress":
|
||||||
compressionFraming = .compress
|
compressionFraming = .compress
|
||||||
if $0.count > 1 {
|
if $0.count == 1 {
|
||||||
compressionAlgorithm = .other
|
|
||||||
} else {
|
|
||||||
compressionAlgorithm = .disabled
|
compressionAlgorithm = .disabled
|
||||||
|
} else if ($0.count == 2) && ($0[1] == "lzo") {
|
||||||
|
compressionAlgorithm = .LZO
|
||||||
|
} else {
|
||||||
|
compressionAlgorithm = .other
|
||||||
}
|
}
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
Loading…
Reference in New Issue