Browse Source

Don't check and throw exception in a display function. We should check this at input side.

tags/3.4.2
noisyfox 8 years ago
parent
commit
f66638d14c
1 changed files with 1 additions and 3 deletions
  1. +1
    -3
      shadowsocks-csharp/Model/Server.cs

+ 1
- 3
shadowsocks-csharp/Model/Server.cs View File

@@ -45,9 +45,7 @@ namespace Shadowsocks.Model
string serverStr; string serverStr;
// CheckHostName() won't do a real DNS lookup // CheckHostName() won't do a real DNS lookup
var hostType = Uri.CheckHostName( server ); var hostType = Uri.CheckHostName( server );
if ( hostType == UriHostNameType.Unknown ) {
throw new FormatException("Invalid Server Address.");
}
switch ( hostType ) { switch ( hostType ) {
case UriHostNameType.IPv6: case UriHostNameType.IPv6:
serverStr = $"[{server}]:{server_port}"; serverStr = $"[{server}]:{server_port}";


Loading…
Cancel
Save