--- innwebd/bbsd.cpp 2004/07/03 05:34:51 1.2 +++ innwebd/bbsd.cpp 2004/07/03 13:56:04 1.4 @@ -34,10 +34,13 @@ int bbsd::Accept(void) CDBVariant dbVar; CString sql,out,cmd; char temp[256]; + HANDLE hThreadCurrent; long u_online,u_anonymous,u_total; try { + hThreadCurrent = GetCurrentThread(); + u_online = 0; sql = "select SID as cc from user_online group by SID"; RS.Open(CRecordset::snapshot,sql,CRecordset::forwardOnly | CRecordset::readOnly); @@ -78,16 +81,20 @@ int bbsd::Accept(void) "注册用户数[\033[36m%ld\033[32m]\r\n" "\033[1;37m本站目前尚未开设telnet服务 请使用Web方式访问\r\n\r\n" "\033[1;32m http://%s \033[m\r\n", - this->innd_name,u_online,MAX_THREAD,u_anonymous,u_total, + this->innd_name,u_online,MAX_CLIENT,u_anonymous,u_total, this->innd_server,this->innd_server); this->s_send(out); while(!this->thread_terminate) { + this->GetParentThread()->GetThreadPool()->SetThreadStatus(hThreadCurrent,thread_pool::S_WAITING); + if (this->s_receive(out) == 0) //Connection closed break; out.Trim(); + this->GetParentThread()->GetThreadPool()->SetThreadStatus(hThreadCurrent,thread_pool::S_WORKING); + if (sscanf(out,"%20s",temp) ==1) cmd = strupr(temp); else