| 14 |
|
|
| 15 |
#include "StdAfx.h" |
#include "StdAfx.h" |
| 16 |
#include ".\innd.h" |
#include ".\innd.h" |
| 17 |
#include ".\nntp_active.h" |
#include ".\base_active.h" |
| 18 |
#include ".\App_common.h" |
#include ".\App_common.h" |
| 19 |
|
|
| 20 |
using namespace std; |
using namespace std; |
| 33 |
{ |
{ |
| 34 |
CString out,cmd; |
CString out,cmd; |
| 35 |
char temp[256]; |
char temp[256]; |
| 36 |
|
HANDLE hThreadCurrent; |
| 37 |
|
|
| 38 |
try |
try |
| 39 |
{ |
{ |
| 40 |
|
hThreadCurrent = GetCurrentThread(); |
| 41 |
|
|
| 42 |
out.Format("200 %s ready.",App_common::GetVersion()); |
out.Format("200 %s ready.",App_common::GetVersion()); |
| 43 |
this->s_send(out); |
this->s_send(out); |
| 44 |
while(!this->thread_terminate) |
while(!this->thread_terminate) |
| 45 |
{ |
{ |
| 46 |
|
this->GetParentThread()->GetThreadPool()->SetThreadStatus(hThreadCurrent,thread_pool::S_WAITING); |
| 47 |
|
|
| 48 |
if (this->s_receive(out) == 0) //Connection closed |
if (this->s_receive(out) == 0) //Connection closed |
| 49 |
break; |
break; |
| 50 |
out.Trim(); |
out.Trim(); |
| 51 |
|
|
| 52 |
|
this->GetParentThread()->GetThreadPool()->SetThreadStatus(hThreadCurrent,thread_pool::S_WORKING); |
| 53 |
|
|
| 54 |
syslog << logfile::log_head << "Cmd: " << out << endl; |
syslog << logfile::log_head << "Cmd: " << out << endl; |
| 55 |
|
|
| 56 |
if (sscanf(out,"%20s",temp) ==1) |
if (sscanf(out,"%20s",temp) ==1) |
| 368 |
|
|
| 369 |
int innd::Shutdown(void) |
int innd::Shutdown(void) |
| 370 |
{ |
{ |
| 371 |
nntp_active nntpClient; |
base_active nntpClient; |
| 372 |
|
|
| 373 |
if (this->thread_terminate) |
if (this->thread_terminate) |
| 374 |
return 1; |
return 1; |