mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Fix exceptions not handled in DoHTTPSRequest
Bug report by GetPots. Thanks!
This commit is contained in:
parent
f5575d7f8b
commit
f82cb8f83a
1 changed files with 23 additions and 10 deletions
|
|
@ -396,7 +396,10 @@ namespace MinecraftClient.Protocol
|
||||||
{
|
{
|
||||||
string postResult = null;
|
string postResult = null;
|
||||||
int statusCode = 520;
|
int statusCode = 520;
|
||||||
|
Exception exception = null;
|
||||||
AutoTimeout.Perform(() =>
|
AutoTimeout.Perform(() =>
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
TcpClient client = ProxyHandler.newTcpClient(host, 443, true);
|
TcpClient client = ProxyHandler.newTcpClient(host, 443, true);
|
||||||
SslStream stream = new SslStream(client.GetStream());
|
SslStream stream = new SslStream(client.GetStream());
|
||||||
|
|
@ -410,8 +413,18 @@ namespace MinecraftClient.Protocol
|
||||||
statusCode = Settings.str2int(raw_result.Split(' ')[1]);
|
statusCode = Settings.str2int(raw_result.Split(' ')[1]);
|
||||||
}
|
}
|
||||||
else statusCode = 520; //Web server is returning an unknown error
|
else statusCode = 520; //Web server is returning an unknown error
|
||||||
|
}
|
||||||
|
catch (Exception e)
|
||||||
|
{
|
||||||
|
if (!(e is System.Threading.ThreadAbortException))
|
||||||
|
{
|
||||||
|
exception = e;
|
||||||
|
}
|
||||||
|
}
|
||||||
}, TimeSpan.FromSeconds(30));
|
}, TimeSpan.FromSeconds(30));
|
||||||
result = postResult;
|
result = postResult;
|
||||||
|
if (exception != null)
|
||||||
|
throw exception;
|
||||||
return statusCode;
|
return statusCode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue