pro510
Every now and then when I call the Release function on the library it hangs and does not return. The ftp log does not give any hint:
[20051215 15:25:06] SmartFTP FTP Library v1.5.7.5
[20051215 15:25:06] Resolving host name "169.254.109.212"
[20051215 15:25:06] Connecting to 169.254.109.212 Port: 21
[20051215 15:25:06] Connected to 169.254.109.212.
[20051215 15:25:06] 220 Service ready for new user.
[20051215 15:25:06] USER bssaudio
[20051215 15:25:06] 331 User name okay, need password.
[20051215 15:25:06] PASS trousers
[20051215 15:25:07] 230 User logged in, proceed.
[20051215 15:25:07] SYST
[20051215 15:25:07] 215 BSS system type.
[20051215 15:25:07] FEAT
[20051215 15:25:07] 500 Syntax error, command unrecognized.
[20051215 15:25:07] TYPE I
[20051215 15:25:07] 200 Command okay.
[20051215 15:25:07] REST 0
[20051215 15:25:07] 550 Requested action not taken.
[20051215 15:25:07] PWD
[20051215 15:25:07] 257 "/" is Current Directory
[20051215 15:25:07] PORT 169,254,59,100,166,109
[20051215 15:25:07] 200 Command okay.
[20051215 15:25:07] RETR dfp.dfh
[20051215 15:25:07] 150 File status okay; about to open data connection.
[20051215 15:25:07] 89 bytes transferred. (1.37 KB/s) (63 ms)
[20051215 15:25:07] 226 Closing data connection.
[20051215 15:25:07] PORT 169,254,59,100,166,111
[20051215 15:25:07] 200 Command okay.
[20051215 15:25:07] RETR 00000000.dfp
[20051215 15:25:07] 150 File status okay; about to open data connection.
[20051215 15:25:07] 64564 bytes transferred. (212 KB/s) (297 ms)
[20051215 15:25:07] 226 Closing data connection.
[20051215 15:25:07] QUIT
[20051215 15:25:07] 221 Service closing control connection.
[20051215 15:25:07] Client closed the connection.
My initialisation and destruction code is as follows:
Here is the stack if that is any use
Any ideas on why this is happening?
[20051215 15:25:06] SmartFTP FTP Library v1.5.7.5
[20051215 15:25:06] Resolving host name "169.254.109.212"
[20051215 15:25:06] Connecting to 169.254.109.212 Port: 21
[20051215 15:25:06] Connected to 169.254.109.212.
[20051215 15:25:06] 220 Service ready for new user.
[20051215 15:25:06] USER bssaudio
[20051215 15:25:06] 331 User name okay, need password.
[20051215 15:25:06] PASS trousers
[20051215 15:25:07] 230 User logged in, proceed.
[20051215 15:25:07] SYST
[20051215 15:25:07] 215 BSS system type.
[20051215 15:25:07] FEAT
[20051215 15:25:07] 500 Syntax error, command unrecognized.
[20051215 15:25:07] TYPE I
[20051215 15:25:07] 200 Command okay.
[20051215 15:25:07] REST 0
[20051215 15:25:07] 550 Requested action not taken.
[20051215 15:25:07] PWD
[20051215 15:25:07] 257 "/" is Current Directory
[20051215 15:25:07] PORT 169,254,59,100,166,109
[20051215 15:25:07] 200 Command okay.
[20051215 15:25:07] RETR dfp.dfh
[20051215 15:25:07] 150 File status okay; about to open data connection.
[20051215 15:25:07] 89 bytes transferred. (1.37 KB/s) (63 ms)
[20051215 15:25:07] 226 Closing data connection.
[20051215 15:25:07] PORT 169,254,59,100,166,111
[20051215 15:25:07] 200 Command okay.
[20051215 15:25:07] RETR 00000000.dfp
[20051215 15:25:07] 150 File status okay; about to open data connection.
[20051215 15:25:07] 64564 bytes transferred. (212 KB/s) (297 ms)
[20051215 15:25:07] 226 Closing data connection.
[20051215 15:25:07] QUIT
[20051215 15:25:07] 221 Service closing control connection.
[20051215 15:25:07] Client closed the connection.
My initialisation and destruction code is as follows:
CFTPClient::CFTPClient ()
{
m_bInitialised = FALSE;
// init COM for this thread
::CoInitialize(NULL);
try
{
sfFTPLib::IGlobalPtr pGlobal;
if(SUCCEEDED(pGlobal.CreateInstance(__uuidof(sfFTPLib::Global))))
{
// Load the licence file into the DLL
if (pGlobal->LoadLicenseKeyData(_szLicence))
{
HRESULT hr = m_ftp.CreateInstance(__uuidof(sfFTPLib::FTPConnectionMTA));
if (SUCCEEDED(hr))
{
m_bInitialised = TRUE;
if (nGetRegistryInt (REG_SECTION_GENERAL, _T("LogFTP"), FALSE, FALSE))
{
// Use log file
m_ftp->LogFile = _T("C:\\FTPLOG.TXT");
}
// Set timeout
m_ftp->Timeout = nGetRegistryInt (REG_SECTION_GENERAL, _T("FTPTimeout"), 30, FALSE);// 30 second timeout
}
}
else
{
AfxMessageBox(_T("Failed to load FTP license key data."), MB_ICONERROR);
}
}
}
catch (_com_error& ce)
{
dump_com_error (ce);
}
ASSERT (m_bInitialised);
}
CFTPClient::~CFTPClient ()
{
if (m_ftp)
{
// Release ftp client
m_ftp.Release (); // This is the function call which hange
}
::CoUninitialize ();
}
Here is the stack if that is any use
ntdll.dll!7c90eb94()
ntdll.dll!7c90e9ab()
kernel32.dll!7c8094f2()
user32.dll!77d48832()
user32.dll!77d487ff()
kernel32.dll!7c8399f3()
user32.dll!77d4bbfe()
user32.dll!77d49278()
user32.dll!77d4bcad()
sfFTPLib.dll!11978724()
sfFTPLib.dll!11978a15()
sfFTPLib.dll!11946b3f()
sfFTPLib.dll!119537f8()
sfFTPLib.dll!11953858()
sfFTPLib.dll!1195370e()
Roadrunner.exe!_com_ptr_t<_com_IIID<sfFTPLib::IFTPConnection,&_GUID_65d75061_6343_4124_9d64_64f1eabb34c2> >::Release() Line 582 + 0x12 C++
> Roadrunner.exe!CFTPClient::~CFTPClient() Line 136 C++
Any ideas on why this is happening?