protected override void HandleCompleted(BaseAsyncResult.PerRequest pereq) { if (pereq != null) { base.SetCompletedSynchronously(pereq.RequestCompletedSynchronously); if (pereq.RequestCompleted) { Interlocked.CompareExchange <BaseAsyncResult.PerRequest>(ref this.perRequest, null, pereq); pereq.Dispose(); } } base.HandleCompleted(); }
protected override void FinishCurrentChange(BaseAsyncResult.PerRequest pereq) { base.FinishCurrentChange(pereq); if (this.ResponseStream.Position != 0L) { this.ResponseStream.Position = 0L; this.HandleOperationResponseData(this.httpWebResponse, this.ResponseStream); } else { this.HandleOperationResponseData(this.httpWebResponse, null); } pereq.Dispose(); base.perRequest = null; if (!pereq.RequestCompletedSynchronously && !base.IsCompletedInternally) { this.BeginCreateNextChange(); } }