mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 14:56:06 +02:00
sanity check
This commit is contained in:
@@ -59,21 +59,30 @@ namespace VRCX
|
||||
{
|
||||
var values = new object[reader.FieldCount];
|
||||
reader.GetValues(values);
|
||||
if (callback.CanExecute == true)
|
||||
{
|
||||
callback.ExecuteAsync(null, values);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (callback.CanExecute == true)
|
||||
{
|
||||
callback.ExecuteAsync(null, null);
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
m_ConnectionLock.ExitReadLock();
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (callback.CanExecute == true)
|
||||
{
|
||||
callback.ExecuteAsync(e.Message, null);
|
||||
}
|
||||
}
|
||||
|
||||
callback.Dispose();
|
||||
}
|
||||
|
||||
@@ -4,6 +4,7 @@ using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Runtime.Serialization.Formatters.Binary;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace VRCX
|
||||
{
|
||||
@@ -124,6 +125,8 @@ namespace VRCX
|
||||
using (var response = await request.GetResponseAsync() as HttpWebResponse)
|
||||
using (var stream = response.GetResponseStream())
|
||||
using (var streamReader = new StreamReader(stream))
|
||||
{
|
||||
if (callback.CanExecute == true)
|
||||
{
|
||||
callback.ExecuteAsync(null, new
|
||||
{
|
||||
@@ -132,12 +135,15 @@ namespace VRCX
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (WebException webException)
|
||||
{
|
||||
if (webException.Response is HttpWebResponse response)
|
||||
{
|
||||
using (var stream = response.GetResponseStream())
|
||||
using (var streamReader = new StreamReader(stream))
|
||||
{
|
||||
if (callback.CanExecute == true)
|
||||
{
|
||||
callback.ExecuteAsync(null, new
|
||||
{
|
||||
@@ -146,17 +152,21 @@ namespace VRCX
|
||||
});
|
||||
}
|
||||
}
|
||||
else
|
||||
}
|
||||
else if (callback.CanExecute == true)
|
||||
{
|
||||
callback.ExecuteAsync(webException.Message, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
if (callback.CanExecute == true)
|
||||
{
|
||||
// FIXME: 브라우저는 종료되었는데 얘는 이후에 실행되면 터짐
|
||||
callback.ExecuteAsync(e.Message, null);
|
||||
}
|
||||
}
|
||||
|
||||
callback.Dispose();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user