1
0
mirror of https://github.com/v2fly/v2ray-core.git synced 2024-12-30 05:56:54 -05:00

fix compatibility with shadowrocket. fixes #920

This commit is contained in:
Darien Raymond 2018-03-06 10:59:37 +01:00
parent 4b5a5810a3
commit a1401e7632
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -102,7 +102,12 @@ func NewServerSession(validator protocol.UserValidator, sessionHistory *SessionH
func parseSecurityType(b byte) protocol.SecurityType {
if _, f := protocol.SecurityType_name[int32(b)]; f {
return protocol.SecurityType(b)
st := protocol.SecurityType(b)
// For backward compatibility.
if st == protocol.SecurityType_UNKNOWN {
st = protocol.SecurityType_LEGACY
}
return st
}
return protocol.SecurityType_UNKNOWN
}