使用 WinINet 时被动 FTP 超时
我尝试使用被动 ftp 来 ftp 文件,但在调用 put
命令时出现超时 (12002)。
我可以在其他 ftp 站点上使用被动 ftp,但不能在这个新站点上使用。
我在同一台服务器上使用三种不同的方式尝试过:
- FileZilla 客户端处于被动模式 - 这有效
- 被动模式下的 WinINet 库 - 调用 PutFile 时出现超时
- IE 6 处于被动模式 - 尝试列出目录时出现超时
这是在 Windows 2000 服务器上。
我认为自从 FileZilla 工作以来我的防火墙设置正确。
谁能帮我弄清楚发生了什么事吗?
I'm trying to ftp a file using passive ftp but I get a timeout (12002) when the put
command is called.
I'm able to use passive ftp with other ftp sites but not this new one.
I've tried this using three different ways on the same server:
- FileZilla Client in passive mode - this works
- WinINet libarary in passive mode - I get a timeout when calling PutFile
- IE 6 in passive mode - I get a timeout when the directory listing is attempted
This is on a Windows 2000 server.
I assume my firewall is set up correctly since FileZilla worked.
Can anyone help me figure out what's going on?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在被动模式下,FTP 服务器在其一端打开一个端口,并告诉 FTP 客户端它需要连接的 IP/端口。在客户端,它创建一个新的套接字,将其绑定到本地IP/端口(通常是随机IP/端口,除非另有配置),并连接到服务器指定的IP/端口。如果没有实际看到网络数据包嗅探器(如 Wireshark)的跟踪日志,那么我猜测客户端的防火墙/路由器正在阻止出站连接,或者服务器端的防火墙/路由器正在阻止入站连接。 FileZilla 顺利通过这一事实可能意味着连接两端的 IP/端口对恰好与接受两端连接的所有防火墙/路由器规则相匹配,而 WinInet/IE IP/端口对中的某些内容是反而被拒绝。不过,这有点不寻常,因为被动模式往往比主动模式对防火墙/路由器更友好。您是否尝试过使用 Windows 命令行 ftp.exe 实用程序来查看它是否有效?顺便说一句,IE 的所有连接都使用 WinInet。
In Passive mode, the FTP server opens a port on its end and tells the FTP client the IP/Port it needs to connect to. On the client end, it creates a new socket, binds it to a local IP/Port (usually a random IP/Port unless configured otherwise), and connects to the server's specified IP/Port. Without actually seeing a trace log from a network packet sniffer, like Wireshark, then I would guess that either a firewall/router on the client end is blocking the outbound connection, or a firewall/router on the server end is blocking the inbound connection. The fact that FileZilla is getting through OK probably means that the IP/Port pairs on both ends of the connection happen to match all the firewall/router rules for accepting connections on both ends, whereas something in the WinInet/IE IP/Port pairs is getting rejected instead. That is a little unusual since Passive mode tends to be more firewall/router friendly than Active mode, though. Have you tried using Windows' command-line ftp.exe utility to see if it works or not? BTW, IE uses WinInet for all of its connections.