private void cd_ResponseReceived(object sender, ResponseReceivedEventArgs e) { var cd = (HttpRangeDownloader)sender; if (Info == null) { Info = HttpDownloadInfo.GetFromResponse(e.Response, Url); LastInfo = Info.Clone(); cd.Info = Info.Clone(); cd.Wait = Info.AcceptRanges; var chunkedHeader = e.Response.Headers[HttpResponseHeader.TransferEncoding]; UseChunk = Info.AcceptRanges && chunkedHeader != null && chunkedHeader.ToLower() == "chunked"; Ranges.First().End = Info.ContentSize - 1; //NofThread = Info.AcceptRanges ? NofThread : 1; DownloadInfoReceived.Raise(this, EventArgs.Empty); } if (NofActiveThreads > 1 && Info.AcceptRanges && Info.ResumeCapability != Resumeability.Yes) { Info.ResumeCapability = Resumeability.Yes; foreach (var a in cdList) { Info.AcceptRanges = true; a.Info.AcceptRanges = true; } foreach (var item in cdList.Where(x => x.Wait)) { item.Wait = false; } } if (Info.ContentSize < 10 * 1024 + 1) { foreach (var item in cdList.Where(x => x.Wait)) { item.Wait = false; } } createNewThreadIfRequired(); }