修正NetUri解析协议类型的错误

This commit is contained in:
大石头 2017-08-20 23:08:20 +08:00
parent f36953befc
commit 1abdedef5a
1 changed files with 4 additions and 3 deletions

View File

@ -12,11 +12,12 @@ NetUri::NetUri()
NetUri::NetUri(const String& uri) : NetUri() NetUri::NetUri(const String& uri) : NetUri()
{ {
if(uri.CompareTo("Tcp", 3, true) == 0) auto t = uri.Substring(0, 3);
if(t.EqualsIgnoreCase("Tcp"))
Type = NetType::Tcp; Type = NetType::Tcp;
else if(uri.CompareTo("Udp", 3, true) == 0) else if(t.EqualsIgnoreCase("Udp"))
Type = NetType::Udp; Type = NetType::Udp;
else if(uri.CompareTo("Http", 4, true) == 0) else if(uri.Substring(0, 4).EqualsIgnoreCase("Http"))
Type = NetType::Http; Type = NetType::Http;
int p = uri.LastIndexOf("/"); int p = uri.LastIndexOf("/");