2

是的,这个问题几年前已经在这里提出并回答了。

我唯一的问题是答案与现实不符。应该重用 FTP 连接,但事实并非如此。我的 curl 版本是 7.44.0 32/64 位,操作系统:linux/AIX。详细模式和 tcpdump 都证明每次文件上传都会打开一个新连接。另外url.c中有这部分:

/*
 * IsPipeliningPossible() returns TRUE if the options set would allow
 * pipelining/multiplexing and the connection is using a HTTP protocol.
 */
static bool IsPipeliningPossible(const struct SessionHandle *handle,
                                 const struct connectdata *conn)
  /* If a HTTP protocol and pipelining is enabled */
  if(conn->handler->protocol & PROTO_FAMILY_HTTP) {

这可以防止 FTP 协议重用相同的连接。

4

1 回答 1

2

正如您通过引用源代码指出的那样,您只需修复libcurl; 既然你已经找到了开始的地方,你为什么不这样做呢?添加您自己需要的功能是免费和开源软件模型的一大优势。

于 2015-09-25T16:15:13.270 回答