[Modify] Replace it

This commit is contained in:
sta 2016-03-12 15:44:31 +09:00
parent 12e7fb1498
commit 6817a3aa00

View File

@ -482,20 +482,22 @@ namespace WebSocketSharp
set { set {
lock (_forConn) { lock (_forConn) {
var msg = checkIfAvailable (true, false, true, false, false, true); string msg;
if (msg == null) { if (!checkIfAvailable (true, false, true, false, false, true, out msg)) {
_logger.Error (msg);
error ("An error has occurred in setting the origin.", null);
return;
}
if (value.IsNullOrEmpty ()) { if (value.IsNullOrEmpty ()) {
_origin = value; _origin = value;
return; return;
} }
Uri origin; Uri origin;
if (!Uri.TryCreate (value, UriKind.Absolute, out origin) || origin.Segments.Length > 1) if (!Uri.TryCreate (value, UriKind.Absolute, out origin) || origin.Segments.Length > 1) {
msg = "The syntax of an origin must be '<scheme>://<host>[:<port>]'."; _logger.Error ("The syntax of an origin must be '<scheme>://<host>[:<port>]'.");
}
if (msg != null) {
_logger.Error (msg);
error ("An error has occurred in setting the origin.", null); error ("An error has occurred in setting the origin.", null);
return; return;