--- innwebd/base_active.cpp 2004/09/16 15:41:14 1.5 +++ 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; } @@ -533,11 +533,10 @@ int base_active::post_article(const char { //Begin post sql.Format("select bbs.*,innd_conf.group,innd_todo.ID,innd_todo.SID as doSID," - "user_list.username,subdate(bbs.sub_dt, interval '8' hour)" + "subdate(bbs.sub_dt, interval '8' hour)" " as sub_gmt from innd_todo inner join innd_conf on" " innd_todo.server=innd_conf.server and innd_todo.SID=innd_conf.SID left join bbs on" - " innd_todo.AID=bbs.AID inner join user_list on" - " bbs.UID=user_list.UID where innd_conf.out=1 and" + " innd_todo.AID=bbs.AID where innd_conf.out=1 and" " innd_conf.passive_mode=0 and innd_conf.server='%s' and" " bbs.visible and innd_todo.op='P' order by bbs.AID",news_server); @@ -574,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; @@ -632,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; } @@ -652,13 +653,12 @@ int base_active::post_cancel(const char* try { //Begin post - sql.Format("select bbs.nickname,innd_todo.ID,innd_conf.group,innd_todo.SID as doSID," - "user_list.username,innd_todo.AID," + sql.Format("select bbs.username,bbs.nickname,innd_todo.ID,innd_conf.group," + "innd_todo.SID as doSID,innd_todo.AID," "subdate(innd_todo.dt,interval '8' hour) as dt," "innd_log.msg_id from innd_todo inner join innd_conf on" " innd_todo.server=innd_conf.server and innd_todo.SID=innd_conf.SID left join bbs on" - " innd_todo.AID=bbs.AID inner join user_list on" - " bbs.UID=user_list.UID inner join innd_log on" + " innd_todo.AID=bbs.AID inner join innd_log on" " innd_todo.AID=innd_log.AID where innd_conf.out=1 and" " innd_conf.passive_mode=0 and innd_conf.server='%s' and" " innd_todo.op='C' and innd_log.cancel=0 order by innd_todo.AID",news_server); @@ -692,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; @@ -734,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; } @@ -829,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; } @@ -896,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; } @@ -919,11 +925,10 @@ int base_active::ihave_article(const cha { //Begin ihave sql.Format("select bbs.*,innd_todo.ID,innd_conf.group,innd_todo.SID as doSID," - "user_list.username,subdate(bbs.sub_dt, interval '8' hour)" + "subdate(bbs.sub_dt, interval '8' hour)" " as sub_gmt from innd_todo inner join innd_conf on" " innd_todo.server=innd_conf.server and innd_todo.SID=innd_conf.SID left join bbs on" - " innd_todo.AID=bbs.AID inner join user_list on" - " bbs.UID=user_list.UID where innd_conf.out=1 and" + " innd_todo.AID=bbs.AID where innd_conf.out=1 and" " innd_conf.passive_mode=1 and innd_conf.server='%s' and" " bbs.visible and innd_todo.op='P' order by bbs.AID",news_server); @@ -957,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; @@ -1025,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; } @@ -1045,13 +1055,12 @@ int base_active::ihave_cancel(const char try { //Begin ihave - sql.Format("select bbs.nickname,innd_todo.ID,innd_conf.group,innd_todo.SID as doSID," - "user_list.username,innd_todo.AID," + sql.Format("select bbs.username,bbs.nickname,innd_todo.ID,innd_conf.group," + "innd_todo.SID as doSID,innd_todo.AID," "subdate(innd_todo.dt,interval '8' hour) as dt," "innd_log.msg_id from innd_todo inner join innd_conf on" " innd_todo.server=innd_conf.server and innd_todo.SID=innd_conf.SID left join bbs on" - " innd_todo.AID=bbs.AID inner join user_list on" - " bbs.UID=user_list.UID inner join innd_log on" + " innd_todo.AID=bbs.AID inner join innd_log on" " innd_todo.AID=innd_log.AID where innd_conf.out=1 and" " innd_conf.passive_mode=1 and innd_conf.server='%s' and" " innd_todo.op='C' and innd_log.cancel=0 order by innd_todo.AID",news_server); @@ -1082,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; } @@ -1200,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; } @@ -1237,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; } @@ -1279,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 +}