【发布时间】:2021-04-30 08:28:52
【问题描述】:
我们正在使用 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 重组有问题,还是服务器/网络问题。
【问题讨论】: