Fix new IPC ObjectDisposedException

This commit is contained in:
JustArchi
2017-12-09 20:49:39 +01:00
parent 01753bbd45
commit 135e25d5a7

View File

@@ -436,8 +436,8 @@ namespace ArchiSteamFarm {
response.ContentLength64 = content.Length;
await response.OutputStream.WriteAsync(content, 0, content.Length).ConfigureAwait(false);
} catch (Exception e) {
ASF.ArchiLogger.LogGenericDebuggingException(e);
} catch (ObjectDisposedException) {
// Ignored, request is no longer valid
}
}
@@ -475,6 +475,7 @@ namespace ArchiSteamFarm {
return;
}
try {
if (response.ContentEncoding == null) {
response.ContentEncoding = Encoding.UTF8;
}
@@ -483,6 +484,9 @@ namespace ArchiSteamFarm {
byte[] content = response.ContentEncoding.GetBytes(text + Environment.NewLine);
await ResponseBase(request, response, content, statusCode).ConfigureAwait(false);
} catch (ObjectDisposedException) {
// Ignored, request is no longer valid
}
}
private static async Task ResponseText(HttpListenerRequest request, HttpListenerResponse response, string text, HttpStatusCode statusCode = HttpStatusCode.OK) {