static private DisposeResponse ( |
||
wr | ||
bGetStream | bool | |
return | void |
public override void Close() { base.Close(); #endif if (MonoWorkarounds.IsRequired(10163) && m_bWrite) { try { Stream s = this.BaseStream; Type t = s.GetType(); if (t.Name == "WebConnectionStream") { PropertyInfo pi = t.GetProperty("Request", BindingFlags.Instance | BindingFlags.NonPublic); if (pi != null) { WebRequest wr = (pi.GetValue(s, null) as WebRequest); if (wr != null) { IOConnection.DisposeResponse(wr.GetResponse(), false); } else { Debug.Assert(false); } } else { Debug.Assert(false); } } } catch (Exception) { Debug.Assert(false); } } }
protected override void Dispose(bool disposing) { base.Dispose(disposing); if (disposing && MonoWorkarounds.IsRequired(10163) && m_bWrite && !m_bDisposed) { try { Stream s = this.BaseStream; Type t = s.GetType(); if (t.Name == "WebConnectionStream") { PropertyInfo pi = t.GetProperty("Request", BindingFlags.Instance | BindingFlags.NonPublic); if (pi != null) { WebRequest wr = (pi.GetValue(s, null) as WebRequest); if (wr != null) #if KeePassUWP { var task = wr.GetResponseAsync(); task.RunSynchronously(); var response = task.Result; IOConnection.DisposeResponse(response, false); } #else { IOConnection.DisposeResponse(wr.GetResponse(), false); } #endif else { Debug.Assert(false); } } else { Debug.Assert(false); } } }