如何解决卷曲下载给大文件下载错误 CURLE_PARTIAL_FILE
我们正在使用 curl 库 7.73.0 。它与源代码相关联。我们使用 Curl 从 HTTP 服务器下载大文件。此文件大小为 750 MB。在下载过程中,有时我们会收到 CURLE_PARTIAL_FILE 错误。我想了解这个错误的原因。它进入 Curl 库中的 transfer.c 文件循环并中止。我想了解这个循环究竟表示什么。
if(!(data->set.opt_no_body) && k->chunk &&
(conn->chunk.state != CHUNK_STOP)) {
/*
* In chunked mode,return an error if the connection is closed prior to
* the empty (terminating) chunk is read.
*
* The condition above used to check for
* conn->proto.http->chunk.datasize != 0 which is true after reading
* *any* chunk,not just the empty chunk.
*
*/
failf(data,"transfer closed with outstanding read data remaining");
return CURLE_PARTIAL_FILE;
}
如果有人能解释上面的支票应该代表什么,那会很有帮助。我们想调试这个问题,以考虑我们是否在客户端的 TCP 重组中存在问题,或者是服务器/网络问题。
解决方法
事实证明,问题确实出在服务器中途停止传输。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。