gpt4 book ai didi

ruby - 遏制 epsv 问题

转载 作者:太空宇宙 更新时间:2023-11-03 16:58:44 31 4
gpt4 key购买 nike

我在使用 Curb(ruby curl 绑定(bind))进行 FTP 下载时遇到问题。

当扩展被动模式失败时,curb 似乎不会退回到简单被动模式。从日志中提取如下:

< 250 Directory changed to /outgoing/productcatalog/35591
> EPSV
* Connect data stream passively
< 229 Entering Passive Mode (|||40938|)
* Trying 216.34.207.42... * Connecting to 216.34.207.42 (216.34.207.42) port 40938
* Connection failed
* Expire cleared
* Closing connection #0

然后抛出 Curl::Err::ConnectionFailedError: 无法连接到服务器

但是,如果我在命令行中使用 curl,我会得到

< 250 Directory changed to /outgoing/productcatalog/35591
> EPSV
* Connect data stream passively
< 229 Entering Passive Mode (|||43267|)
* Trying 216.34.207.42... Connection refused
* couldn't connect to host
* got positive EPSV response, but can't connect. Disabling EPSV
> PASV
< 227 Entering Passive Mode (216,34,207,42,169,4)
* Trying 216.34.207.42... connected

解决方案是完全禁用 epsv,但 Curb 似乎不可能,没有这样的选项。在这种情况下可以做什么?

最佳答案

禁用 EPSV 的 libcurl 选项是一个简单的 bool 选项,curb 应该已经支持许多其他类似的选项。添加对此的支持应该是相当微不足道的。

关于ruby - 遏制 epsv 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1952511/

31 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com