--- innwebd/base_active.cpp 2004/12/01 08:31:52 1.6 +++ innwebd/base_active.cpp 2008/04/11 17:14:49 1.9 @@ -1,14 +1,10 @@ /*******************************************************/ /* */ /* LeafOK Innbbsd */ -/* Copyright (C) LeafOK.com, 2003-2004 */ /* */ -/* Programmed by Leaf */ -/* E-mail:leaflet@leafok.com QQ:6049044 */ +/* Copyright (C) LeafOK.com, 2003-2008 */ /* */ -/* http://bbs.leafok.com */ -/* http://bbs.leafok.net */ -/* http://bbs.fenglin.info */ +/* http://www.leafok.com */ /* */ /*******************************************************/ @@ -269,7 +265,9 @@ int base_active::get_article(const char* } catch(CException* e) { - syslog << logfile::log_head << "[" << news_server << "] Getting article error in get_article()" << endl; + char strErrMsg[1024]; + e->GetErrorMessage(strErrMsg,1024); + syslog << logfile::log_head << "[" << news_server << "] Getting article error in get_article() [" << strErrMsg << "]" << endl; e->Delete(); return -1; } @@ -510,7 +508,9 @@ int base_active::get_cancel(const char* } catch(CException* e) { - syslog << logfile::log_head << "[" << news_server << "] Getting article error in get_article()" << endl; + char strErrMsg[1024]; + e->GetErrorMessage(strErrMsg,1024); + syslog << logfile::log_head << "[" << news_server << "] Getting article error in get_article() [" << strErrMsg << "]" << endl; e->Delete(); return -1; } @@ -573,7 +573,7 @@ int base_active::post_article(const char sql.Format("delete from innd_todo where ID=%ld",id); this->Db.ExecuteSQL(sql); - syslog << logfile::log_head << "[" << news_server << "] Post failed " << msg_id << endl; + syslog << logfile::log_head << "[" << news_server << "] Post failed " << msg_id << " [" << out << "]" << endl; RS.MoveNext(); continue; @@ -631,7 +631,9 @@ int base_active::post_article(const char } catch(CException* e) { - syslog << logfile::log_head << "[" << news_server << "] Getting article error in post_article()" << endl; + char strErrMsg[1024]; + e->GetErrorMessage(strErrMsg,1024); + syslog << logfile::log_head << "[" << news_server << "] Getting article error in post_article() [" << strErrMsg << "]" << endl; e->Delete(); return -1; } @@ -690,7 +692,7 @@ int base_active::post_cancel(const char* sql.Format("delete from innd_todo where ID=%ld",id); this->Db.ExecuteSQL(sql); - syslog << logfile::log_head << "[" << news_server << "] Post failed " << msg_id << endl; + syslog << logfile::log_head << "[" << news_server << "] Post failed " << msg_id << " [" << out << "]" << endl; RS.MoveNext(); continue; @@ -732,7 +734,9 @@ int base_active::post_cancel(const char* } catch(CException* e) { - syslog << logfile::log_head << "[" << news_server << "] Getting article error in post_cancel()" << endl; + char strErrMsg[1024]; + e->GetErrorMessage(strErrMsg,1024); + syslog << logfile::log_head << "[" << news_server << "] Getting article error in post_cancel() [" << strErrMsg << "]" << endl; e->Delete(); return -1; } @@ -827,7 +831,9 @@ int base_active::get(void) } catch(CException* e) { - syslog << logfile::log_head << "Error in get()" << endl; + char strErrMsg[1024]; + e->GetErrorMessage(strErrMsg,1024); + syslog << logfile::log_head << "Error in get() [" << strErrMsg << "]" << endl; e->Delete(); return -1; } @@ -894,7 +900,9 @@ int base_active::post(void) } catch(CException* e) { - syslog << logfile::log_head << "Error in post()" << endl; + char strErrMsg[1024]; + e->GetErrorMessage(strErrMsg,1024); + syslog << logfile::log_head << "Error in post() [" << strErrMsg << "]" << endl; e->Delete(); return -1; } @@ -954,10 +962,13 @@ int base_active::ihave_article(const cha if (out.Left(3) != "335") { - sql.Format("delete from innd_todo where ID=%ld",id); - this->Db.ExecuteSQL(sql); + if (out.Left(3) == "435") + { + sql.Format("delete from innd_todo where ID=%ld",id); + this->Db.ExecuteSQL(sql); + } - syslog << logfile::log_head << "[" << news_server << "] Ihave failed " << msg_id << endl; + syslog << logfile::log_head << "[" << news_server << "] Ihave failed " << msg_id << " [" << out << "]" << endl; RS.MoveNext(); continue; @@ -1022,7 +1033,9 @@ int base_active::ihave_article(const cha } catch(CException* e) { - syslog << logfile::log_head << "[" << news_server << "] Getting article error in ihave_article()" << endl; + char strErrMsg[1024]; + e->GetErrorMessage(strErrMsg,1024); + syslog << logfile::log_head << "[" << news_server << "] Getting article error in ihave_article() [" << strErrMsg << "]" << endl; e->Delete(); return -1; } @@ -1078,10 +1091,13 @@ int base_active::ihave_cancel(const char if (out.Left(3) != "335") { - sql.Format("delete from innd_todo where ID=%ld",id); - this->Db.ExecuteSQL(sql); + if (out.Left(3) == "435") + { + sql.Format("delete from innd_todo where ID=%ld",id); + this->Db.ExecuteSQL(sql); + } - syslog << logfile::log_head << "[" << news_server << "] Ihave failed " << msg_id << endl; + syslog << logfile::log_head << "[" << news_server << "] Ihave failed " << msg_id << " [" << out << "]" <GetErrorMessage(strErrMsg,1024); + syslog << logfile::log_head << "[" << news_server << "] Getting article error in ihave_cancel() [" << strErrMsg << "]" << endl; e->Delete(); return -1; } @@ -1196,7 +1214,9 @@ int base_active::ihave(void) } catch(CException* e) { - syslog << logfile::log_head << "Error in ihave()" << endl; + char strErrMsg[1024]; + e->GetErrorMessage(strErrMsg,1024); + syslog << logfile::log_head << "Error in ihave() [" << strErrMsg << "]" << endl; e->Delete(); return -1; } @@ -1233,7 +1253,9 @@ bool base_active::check_todo_list(void) } catch(CException* e) { - syslog << logfile::log_head << "Error in check_todo_list()" << endl; + char strErrMsg[1024]; + e->GetErrorMessage(strErrMsg,1024); + syslog << logfile::log_head << "Error in check_todo_list() [" << strErrMsg << "]" << endl; e->Delete(); return false; } @@ -1275,10 +1297,12 @@ DWORD base_active::SendThread(LPVOID pPa } catch(CException* e) { - syslog << logfile::log_head << "Error in SendThread()" << endl; + char strErrMsg[1024]; + e->GetErrorMessage(strErrMsg,1024); + syslog << logfile::log_head << "Error in SendThread() [" << strErrMsg << "]" << endl; e->Delete(); return -1; } return 0; -} \ No newline at end of file +}