| 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; |
| 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); |
| 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; |
| 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 |
|
|
| 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 |
|
} |