[Modify] Move it out

master
sta 9 years ago
parent 32b3043a58
commit 296ede4c33

@ -2818,32 +2818,34 @@ namespace WebSocketSharp
return;
}
lock (_forState) {
if (!checkIfAvailable (true, false, false, true, out msg)) {
_logger.Error (msg);
if (!username.IsNullOrEmpty ()) {
if (username.Contains (':') || !username.IsText ()) {
_logger.Error ("'username' contains an invalid character.");
error ("An error has occurred in setting the credentials.", null);
return;
}
if (username.IsNullOrEmpty ()) {
_logger.Warn ("The credentials are set back to the default.");
_credentials = null;
_preAuth = false;
if (!password.IsNullOrEmpty () && !password.IsText ()) {
_logger.Error ("'password' contains an invalid character.");
error ("An error has occurred in setting the credentials.", null);
return;
}
}
if (username.Contains (':') || !username.IsText ()) {
_logger.Error ("'username' contains an invalid character.");
lock (_forState) {
if (!checkIfAvailable (true, false, false, true, out msg)) {
_logger.Error (msg);
error ("An error has occurred in setting the credentials.", null);
return;
}
if (!password.IsNullOrEmpty () && !password.IsText ()) {
_logger.Error ("'password' contains an invalid character.");
error ("An error has occurred in setting the credentials.", null);
if (username.IsNullOrEmpty ()) {
_logger.Warn ("The credentials are set back to the default.");
_credentials = null;
_preAuth = false;
return;
}

Loading…
Cancel
Save