static void OnGetTokenCallback(IAsyncResult result) { if (result.CompletedSynchronously) { return; } GetWebRequestAsyncResult thisPtr = (GetWebRequestAsyncResult)result.AsyncState; Exception completionException = null; bool completeSelf; try { thisPtr.OnGetToken(result); completeSelf = thisPtr.GetWebRequest(); } #pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) { throw; } completeSelf = true; completionException = e; } if (completeSelf) { thisPtr.Complete(false, completionException); } }
static void OnGetBaseWebRequestCallback(IAsyncResult result) { if (result.CompletedSynchronously) { return; } GetWebRequestAsyncResult thisPtr = (GetWebRequestAsyncResult)result.AsyncState; Exception completionException = null; try { thisPtr.request = thisPtr.httpsChannel.EndBaseGetWebRequest(result); thisPtr.factory.AddServerCertMappingOrSetRemoteCertificateValidationCallback(thisPtr.request, thisPtr.to); } #pragma warning suppress 56500 // Microsoft, transferring exception to another thread catch (Exception e) { if (Fx.IsFatal(e)) { throw; } completionException = e; } thisPtr.Complete(false, completionException); }