added: some debug logs to export plugin

git-svn-id: svn://ttmath.org/publicrep/winix/trunk@952 e52654a7-88a9-db11-a3e9-0013d4bc506e
This commit is contained in:
Tomasz Sowa 2014-02-12 22:32:06 +00:00
parent afbd522362
commit 37b22c3559
1 changed files with 45 additions and 1 deletions

View File

@ -53,8 +53,12 @@ void ExportThread::SetBaseUrl(const std::wstring & url)
void ExportThread::AddMessage(const Message & message)
{
log << log1 << "export thread: a" << logsave << logend;
message_tab.insert(message_tab.end(), message);
WakeUpThread();
log << log1 << "export thread: b" << logsave << logend;
}
@ -66,7 +70,6 @@ void ExportThread::AddMessage(int type, const std::wstring & url, const std::wst
message_add_temp.path = path;
AddMessage(message_add_temp);
WakeUpThread();
}
@ -132,6 +135,10 @@ void ExportThread::DoMessage()
{
bool sent_ok = false;
Lock()
log << log1 << "export thread: c" << logsave << logend;
Unlock();
Convert(message_work.url, url_a);
if( message_work.type == WINIX_PL_EXPORT_TYPE_CREATE_FILE )
@ -150,6 +157,10 @@ void ExportThread::DoMessage()
sent_ok = true;
}
Lock()
log << log1 << "export thread: d" << logsave << logend;
Unlock();
if( sent_ok )
{
@ -169,6 +180,11 @@ void ExportThread::DoMessage()
Unlock();
}
}
Lock()
log << log1 << "export thread: e" << logsave << logend;
Unlock();
}
@ -265,6 +281,9 @@ bool ExportThread::Put()
{
FILE * file = 0;
Lock()
log << log1 << "export thread: 1" << logsave << logend;
Unlock();
if( message_work.type == WINIX_PL_EXPORT_TYPE_CREATE_FILE_STATIC )
{
@ -285,8 +304,16 @@ FILE * file = 0;
}
Lock()
log << log1 << "export thread: 2" << logsave << logend;
Unlock();
CURL * curl = curl_easy_init();
Lock()
log << log1 << "export thread: 3" << logsave << logend;
Unlock();
if( !curl )
{
@ -310,6 +337,12 @@ FILE * file = 0;
Convert(message_work.ftp_login, ftp_login);
Convert(message_work.ftp_pass, ftp_pass);
Lock()
log << log1 << "export thread: 4" << logsave << logend;
Unlock();
curl_easy_setopt(curl, CURLOPT_URL, ftp_server.c_str());
curl_easy_setopt(curl, CURLOPT_USERNAME, ftp_login.c_str());
curl_easy_setopt(curl, CURLOPT_PASSWORD, ftp_pass.c_str());
@ -330,9 +363,20 @@ FILE * file = 0;
}
Lock()
log << log1 << "export thread: x" << logsave << logend;
Unlock();
CURLcode res = curl_easy_perform(curl);
curl_easy_cleanup(curl);
Lock()
log << log1 << "export thread: y" << logsave << logend;
Unlock();
if( file )
fclose(file);