BITS 客户端无法指定 HTTP Range 标头
我们的系统旨在部署到网络连接不可靠和/或不足的地区。我们构建了自己的容错数据复制服务,该服务使用 BITS。
由于一些安全和维护要求,我们在服务器端实现了自己的 ASP.NET 文件下载服务,而不是仅仅让 IIS 提供文件。当 BITS 客户端使用指定的文件范围,我们的 ASP.NET 页面将所需的文件段拉入内存并将其作为 HTTP 响应提供。这就是理论。 ;)这个理论在人工实验室场景中失败了,但我不会让系统部署在现实生活场景中,除非我们能够克服这个问题。
实验室场景:我在同一台开发人员计算机上有 BITS 客户端和 IIS,因此实际上我拥有巨大的网络“带宽”,并且 BITS 足够智能,可以检测到这一点。随着BITS客户端发现无限带宽,它变得越来越“贪婪”。在每个 HTTP 请求中,BITS 想要掌握越来越大的文件范围(我们正在谈论下载 CD iso 文件、视频),在单个 HTTP 请求中要求 20-40MB,我不太愿意将这个大小拉入内存中服务器端一气呵成。我可以通过给予少于需求的量来克服这个问题。没关系。
然而,BITS 在没有指定下载范围的情况下获得了真正“自信”和“傲慢”的高要求文件,即它希望在单个请求中获得整个文件,而这就是问题所在。我不知道在 600MB 文件的情况下如何回答该响应。如果我只提供文件的起始 1MB 范围,BITS 客户端会不断发送对同一文件的 HTTP 请求,而没有继续下载范围,它会强调它希望一次性下载整个文件。由于我不愿意提供整个文件,BITS经过几次尝试后放弃并报告错误。
有什么想法吗?
Our system is designed to deploy to regions with unreliable and/or insufficient network connections. We build our own fault tolerating data replication services that uses BITS.
Due to some security and maintenance requirements, we implemented our own ASP.NET file download service on the server side, instead of just letting IIS serving up the files. When BITS client makes an HTTP download request with the specified range of the file, our ASP.NET page pulls the demanded file segment into memory and serve that up as the HTTP response. That is the theory. ;) This theory fails in artificial lab scenarios but I would not let the system deploy in real life scenarios unless we can overcome that.
Lab scenario: I have BITS client and the IIS on the same developer machine, so practically I have enormous network "bandwidth" and BITS is intelligent enough to detect that. As BITS client discovers the unlimited bandwidth, it gets more and more "greedy". At each HTTP request, BITS wants to grasp greater and greater file ranges (we are talking about downloading CD iso files, videos), demanding 20-40MB inside a single HTTP request, a size that I am not comfortable to pull into memory on the server side as one go. I can overcome that simply by giving less than demanded. It is OK.
However, BITS gets really "confident" and "arrogant" demanding files WITHOUT specifying the download range, i.e., it wants the entire file in a single request, and this is where things go wrong. I do not know how to answer that response in the case of a 600MB file. If I just provide the starting 1MB range of the file, BITS client keeps sending HTTP requests for the same file without download range to continue, it hammers its point that it wants the entire file in one go. Since I am reluctant to provide the entire file, BITS gives up after several trials and reports error.
Any thoughts?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
看来,我们可以解决这个问题了。有几件事:
It seems, we could solve the issue. There are several things: