From 6f261e6bb65835133e582d77c56545372197af0d Mon Sep 17 00:00:00 2001 From: Marcos Henrich Date: Thu, 7 Jul 2016 16:39:21 +0100 Subject: [PATCH] [System] EndRead now throws WebException on abort. When a requast is aborted on .NET a WebException is thrown and not a ObjectDisposedException as we were doing. Fixes #41477 --- mcs/class/System/System.Net/WebConnection.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mcs/class/System/System.Net/WebConnection.cs b/mcs/class/System/System.Net/WebConnection.cs index 28d89a6065c..5178569f3c2 100644 --- a/mcs/class/System/System.Net/WebConnection.cs +++ b/mcs/class/System/System.Net/WebConnection.cs @@ -896,6 +896,8 @@ namespace System.Net { Stream s = null; lock (this) { + if (request.Aborted) + throw new WebException ("Request aborted", WebExceptionStatus.RequestCanceled); if (Data.request != request) throw new ObjectDisposedException (typeof (NetworkStream).FullName); if (nstream == null) -- 2.25.1