From: Marcos Henrich Date: Thu, 7 Jul 2016 15:39:21 +0000 (+0100) Subject: [System] EndRead now throws WebException on abort. X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=6f261e6bb65835133e582d77c56545372197af0d;p=mono.git [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 --- 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)