--- innwebd/innd.cpp 2004/07/03 05:30:04 1.4 +++ innwebd/innd.cpp 2004/07/04 21:54:39 1.8 @@ -1,10 +1,10 @@ /*******************************************************/ /* */ -/* LeafOK Innd */ +/* LeafOK Innbbsd */ /* Copyright (C) LeafOK.com, 2003-2004 */ /* */ /* Programmed by Leaf */ -/* E-mail:leaf@leafok.com QQ:6049044 */ +/* E-mail:leaflet@leafok.com QQ:6049044 */ /* */ /* http://bbs.leafok.com */ /* http://bbs.leafok.net */ @@ -40,10 +40,14 @@ int innd::Accept(void) this->s_send(out); while(!this->thread_terminate) { + this->GetParentThread()->GetThreadPool()->SetThreadStatus(GetCurrentThreadId(),thread_pool::S_WAITING); + if (this->s_receive(out) == 0) //Connection closed break; out.Trim(); + this->GetParentThread()->GetThreadPool()->SetThreadStatus(GetCurrentThreadId(),thread_pool::S_WORKING); + syslog << logfile::log_head << "Cmd: " << out << endl; if (sscanf(out,"%20s",temp) ==1) @@ -152,11 +156,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 | CRecordsset::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); @@ -312,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); @@ -351,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[256]; + e->GetErrorMessage(strErrMsg,256); + syslog << logfile::log_head << "Error in cmd_ihave() [" << strErrMsg << "]" << endl; e->Delete(); return -1; }