[Modify] Polish it

This commit is contained in:
sta 2017-02-07 16:57:51 +09:00
parent 6f89be6319
commit da25c804ee

View File

@ -323,12 +323,14 @@ namespace WebSocketSharp.Server
internal bool Remove (string path)
{
path = HttpUtility.UrlDecode (path).TrimEndSlash ();
WebSocketServiceHost host;
lock (_sync) {
path = HttpUtility.UrlDecode (path).TrimEndSlash ();
if (!_hosts.TryGetValue (path, out host)) {
_logger.Error (
"A WebSocket service with the specified path isn't found:\n path: " + path);
"A WebSocket service with the specified path could not be found."
);
return false;
}
@ -337,7 +339,7 @@ namespace WebSocketSharp.Server
}
if (host.State == ServerState.Start)
host.Stop ((ushort) CloseStatusCode.Away, null);
host.Stop (1001, String.Empty);
return true;
}