/[LeafOK_CVS]/innwebd/base_passive.cpp
ViewVC logotype

Diff of /innwebd/base_passive.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.7 by sysadm, Sun Jul 4 23:35:00 2004 UTC Revision 1.8 by sysadm, Thu Sep 16 15:40:37 2004 UTC
# Line 146  int base_passive::work() Line 146  int base_passive::work()
146    
147                          this->GetParentThread()->GetThreadPool()->SetThreadStatus(GetCurrentThreadId(),thread_pool::S_WORKING);                          this->GetParentThread()->GetThreadPool()->SetThreadStatus(GetCurrentThreadId(),thread_pool::S_WORKING);
148    
   
149                          strcpy(p->hostaddr,inet_ntoa(sin.sin_addr));                          strcpy(p->hostaddr,inet_ntoa(sin.sin_addr));
150                          p->port = sin.sin_port;                          p->port = sin.sin_port;
151                          p->isConnected = true;                          p->isConnected = true;
# Line 160  int base_passive::work() Line 159  int base_passive::work()
159                                  continue;                                  continue;
160                          }                          }
161    
162                          if (!p->access.get)                          if (!p->check_priv())
163                          {                          {
164                                  p->s_send("502 You are not in my access file.\r\n");                                  p->s_send("502 You are not in my access file.\r\n");
165                                  delete(p);                                  delete(p);
# Line 209  DWORD base_passive::AcceptThread(LPVOID Line 208  DWORD base_passive::AcceptThread(LPVOID
208    
209                  p->ulMainThreadId = GetCurrentThreadId();                  p->ulMainThreadId = GetCurrentThreadId();
210    
211                    syslog << logfile::log_head << "Accept connection from " << p->hostaddr
212                            << ":" << p->port << endl;
213    
214                  if (p->GetParentThread()->GetThreadPool()->AddThread(GetCurrentThreadId(), CLOCKS_PER_SEC * 30) != 0)                  if (p->GetParentThread()->GetThreadPool()->AddThread(GetCurrentThreadId(), CLOCKS_PER_SEC * 30) != 0)
215                  {                  {
216                          syslog << logfile::log_head << "Register thread ... Failed" << endl;                          syslog << logfile::log_head << "Register thread ... Failed" << endl;
# Line 250  int base_passive::get_priv(base_passive* Line 252  int base_passive::get_priv(base_passive*
252                  //Default value                  //Default value
253                  strcpy(p->access.ip,p->hostaddr);                  strcpy(p->access.ip,p->hostaddr);
254                  p->access.control = false;                  p->access.control = false;
255                  p->access.get = true;                  p->access.get = false;
256                  p->access.post = false;                  p->access.post = false;
257                  p->access.ihave = false;                  p->access.ihave = false;
258    
# Line 354  int base_passive::w_call(void) Line 356  int base_passive::w_call(void)
356          this->work();          this->work();
357          return 0;          return 0;
358  }  }
359    
360    bool base_passive::check_priv(void)
361    {
362            return this->access.get;
363    }


Legend:
Removed lines/characters  
Changed lines/characters
  Added lines/characters

webmaster@leafok.com
ViewVC Help
Powered by ViewVC 1.3.0-beta1