[Modify] Add a check
This commit is contained in:
parent
49b09654f6
commit
8126aa5111
@ -2870,7 +2870,6 @@ namespace WebSocketSharp
|
|||||||
/// </param>
|
/// </param>
|
||||||
public void SetProxy (string url, string username, string password)
|
public void SetProxy (string url, string username, string password)
|
||||||
{
|
{
|
||||||
lock (_forConn) {
|
|
||||||
string msg;
|
string msg;
|
||||||
if (!checkIfAvailable (true, false, true, false, false, true, out msg)) {
|
if (!checkIfAvailable (true, false, true, false, false, true, out msg)) {
|
||||||
_logger.Error (msg);
|
_logger.Error (msg);
|
||||||
@ -2879,6 +2878,14 @@ namespace WebSocketSharp
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
lock (_forConn) {
|
||||||
|
if (!checkIfAvailable (true, false, false, true, out msg)) {
|
||||||
|
_logger.Error (msg);
|
||||||
|
error ("An error has occurred in setting the proxy.", null);
|
||||||
|
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if (url.IsNullOrEmpty ()) {
|
if (url.IsNullOrEmpty ()) {
|
||||||
_logger.Warn ("The proxy url and credentials are set back to the default.");
|
_logger.Warn ("The proxy url and credentials are set back to the default.");
|
||||||
_proxyUri = null;
|
_proxyUri = null;
|
||||||
|
Loading…
Reference in New Issue
Block a user