I had some problems accessing one FTP Server through a FTP Client
compiled to run in Windows 95/NT. To better understand, I made a
small FTP Client for debugging. The code is listed below, in a
simplified way and without error checking.
hSession = InternetOpen(...);
hFtp = InternetConnect(...);
hFind = FtpFindFirstFile(...);
InternetCloseHandle(hFind);
hFile = FtpOpenFile(...);
InternetReadFile(...);
InternetCloseHandle(hFile);
InternetCloseHandle(hFtp);
InternetCloseHandle(hSession);
Debugging results: in some occasions, the program halts for some
minutes when it calls InternetCloseHandle(hFile).
So I decided to verify what was happening in the FTP Server, and I
realized that the client was sending a command like this: "???ABOR",
not recognized by the Server. I made some tests with several FTP
Servers, and IIS was the only one with no major problems. All the
others (Pharlap ETS, GuildFTPD, ArgoSoft) say that the command
is invalid.
Questions:
- Is the programming sequence correct?
- Does Wininet API have any problem with InternetReadFile?
The same client was made with calls to FtpGetFile and no
problems were noticed.
- How do I make a better debug to solve my problem?