--- innwebd/base_passive.cpp 2004/07/04 08:04:08 1.5 +++ innwebd/base_passive.cpp 2004/09/16 15:40:37 1.8 @@ -144,8 +144,7 @@ int base_passive::work() break; } - this->GetParentThread()->GetThreadPool()->SetThreadStatus(GetCurrentThreadId(),tread_pool::S_WORKING); - + this->GetParentThread()->GetThreadPool()->SetThreadStatus(GetCurrentThreadId(),thread_pool::S_WORKING); strcpy(p->hostaddr,inet_ntoa(sin.sin_addr)); p->port = sin.sin_port; @@ -160,7 +159,7 @@ int base_passive::work() continue; } - if (!p->access.get) + if (!p->check_priv()) { p->s_send("502 You are not in my access file.\r\n"); delete(p); @@ -171,7 +170,7 @@ int base_passive::work() if (this->GetThreadPool()->GetThreadCount() < MAX_CLIENT) { if (hThreadCurrent = CreateThread(NULL,0,(LPTHREAD_START_ROUTINE)base_passive::AcceptThread,(LPVOID)p,0,&ulThreadId)) -// base_passive::uThreadCount++; + { CloseHandle(hThreadCurrent); syslog << logfile::log_head << "Create accept thread ... OK" << endl; } @@ -209,6 +208,9 @@ DWORD base_passive::AcceptThread(LPVOID p->ulMainThreadId = GetCurrentThreadId(); + syslog << logfile::log_head << "Accept connection from " << p->hostaddr + << ":" << p->port << endl; + if (p->GetParentThread()->GetThreadPool()->AddThread(GetCurrentThreadId(), CLOCKS_PER_SEC * 30) != 0) { syslog << logfile::log_head << "Register thread ... Failed" << endl; @@ -250,7 +252,7 @@ int base_passive::get_priv(base_passive* //Default value strcpy(p->access.ip,p->hostaddr); p->access.control = false; - p->access.get = true; + p->access.get = false; p->access.post = false; p->access.ihave = false; @@ -354,3 +356,8 @@ int base_passive::w_call(void) this->work(); return 0; } + +bool base_passive::check_priv(void) +{ + return this->access.get; +}