--- innwebd/innd.cpp 2004/07/03 13:56:04 1.5 +++ innwebd/innd.cpp 2008/04/11 17:14:49 1.13 @@ -1,14 +1,10 @@ /*******************************************************/ /* */ -/* LeafOK Innd */ -/* Copyright (C) LeafOK.com, 2003-2004 */ +/* LeafOK Innbbsd */ /* */ -/* Programmed by Leaf */ -/* E-mail:leaf@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 */ /* */ /*******************************************************/ @@ -33,23 +29,20 @@ int innd::Accept(void) { CString out,cmd; char temp[256]; - HANDLE hThreadCurrent; try { - hThreadCurrent = GetCurrentThread(); - out.Format("200 %s ready.",App_common::GetVersion()); this->s_send(out); while(!this->thread_terminate) { - this->GetParentThread()->GetThreadPool()->SetThreadStatus(hThreadCurrent,thread_pool::S_WAITING); + this->GetParentThread()->GetThreadPool()->SetThreadStatus(GetCurrentThreadId(),thread_pool::S_WAITING); if (this->s_receive(out) == 0) //Connection closed break; out.Trim(); - this->GetParentThread()->GetThreadPool()->SetThreadStatus(hThreadCurrent,thread_pool::S_WORKING); + this->GetParentThread()->GetThreadPool()->SetThreadStatus(GetCurrentThreadId(),thread_pool::S_WORKING); syslog << logfile::log_head << "Cmd: " << out << endl; @@ -127,7 +120,9 @@ int innd::Accept(void) } catch(CException* e) { - syslog << logfile::log_head << "Error in accept()" << endl; + char strErrMsg[1024]; + e->GetErrorMessage(strErrMsg,1024); + syslog << logfile::log_head << "Error in accept() [" << strErrMsg << "]" << endl; e->Delete(); return -1; } @@ -159,11 +154,11 @@ int innd::cmd_list(void) sql = "select * from innd_conf order by `group`"; - RS.Open(CRecordset::snapshot,sql,CRecordst::forwardOnly | CRecordset::readOnly); - while(!RS.IsEEOF()) + RS.Open(CRecordset::snapshot,sql,CRecordset::forwardOnly | CRecordset::readOnly); + while(!RS.IsEOF()) { RS.GetFieldValue("group",dbVar,SQL_C_CHAR); - group = *(dbVr.m_pstring); + group = *(dbVar.m_pstring); art_begin = 1; art_end = 0;; RS.GetFieldValue("in",dbVar,SQL_C_SSHORT); @@ -178,7 +173,9 @@ int innd::cmd_list(void) } catch(CException* e) { - syslog << logfile::log_head << "Error in cmd_list()" << endl; + char strErrMsg[1024]; + e->GetErrorMessage(strErrMsg,1024); + syslog << logfile::log_head << "Error in cmd_list() [" << strErrMsg << "]" << endl; e->Delete(); return -1; } @@ -319,7 +316,7 @@ int innd::cmd_ihave(const char* msg_id) if (strcmp(cmd,"cancel")==0 && strcmp(cancel_msg_id,"")!=0) //Empty Message-ID { //Delete article - sql.Format("select AID from innd_logfile where msg_id='%s'" + sql.Format("select AID from innd_log where msg_id='%s'" " and op='I' and cancel=0",base::addslashes(cancel_msg_id)); RS.Open(CRecordset::snapshot,sql,CRecordset::forwardOnly | CRecordset::readOnly); @@ -358,7 +355,9 @@ int innd::cmd_ihave(const char* msg_id) } catch(CException* e) { - syslog << logfile::log_head << "Error in cmd_ihave()" << endl; + char strErrMsg[1024]; + e->GetErrorMessage(strErrMsg,1024); + syslog << logfile::log_head << "Error in cmd_ihave() [" << strErrMsg << "]" << endl; e->Delete(); return -1; } @@ -399,3 +398,8 @@ int innd::db_env_init(void) } return 0; } + +bool innd::check_priv(void) +{ + return this->access.get; +}