[System]: Properly propage exceptions in HttpWebRequest.BeginGetResponse().
authorMartin Baulig <martin.baulig@xamarin.com>
Wed, 17 Feb 2016 22:44:00 +0000 (17:44 -0500)
committerMartin Baulig <martin.baulig@xamarin.com>
Thu, 18 Feb 2016 01:40:19 +0000 (20:40 -0500)
(cherry picked from commit acf6c4bd3718265bc62aafc6338d024db1a4e950)

mcs/class/System/System.Net/HttpWebRequest.cs

index 1c1c41214b5b11e1f8bc61f2af96dcba1cc28cbb..8b90a5336b55c186b43c8e98adbc40511713b282 100644 (file)
@@ -969,11 +969,17 @@ namespace System.Net
                                        }
                                }
 
-                               if (!requestSent) {
+                               if (requestSent)
+                                       return;
+
+                               try {
                                        requestSent = true;
                                        redirects = 0;
                                        servicePoint = GetServicePoint ();
                                        abortHandler = servicePoint.SendRequest (this, connectionGroup);
+                               } catch (Exception ex) {
+                                       aread.SetCompleted (synch, ex);
+                                       aread.DoCallback ();
                                }
                        });