| 1 |
/*******************************************************/ |
/*******************************************************/ |
| 2 |
/* */ |
/* */ |
| 3 |
/* LeafOK Innd */ |
/* LeafOK Innbbsd */ |
|
/* Copyright (C) LeafOK.com, 2003-2004 */ |
|
| 4 |
/* */ |
/* */ |
| 5 |
/* Programmed by Leaf */ |
/* Copyright (C) LeafOK.com, 2003-2008 */ |
|
/* E-mail:leaf@leafok.com QQ:6049044 */ |
|
| 6 |
/* */ |
/* */ |
| 7 |
/* http://bbs.leafok.com */ |
/* http://www.leafok.com */ |
|
/* http://bbs.leafok.net */ |
|
|
/* http://bbs.fenglin.info */ |
|
| 8 |
/* */ |
/* */ |
| 9 |
/*******************************************************/ |
/*******************************************************/ |
| 10 |
|
|
| 29 |
{ |
{ |
| 30 |
CString out,cmd; |
CString out,cmd; |
| 31 |
char temp[256]; |
char temp[256]; |
|
HANDLE hThreadCurrent; |
|
| 32 |
|
|
| 33 |
try |
try |
| 34 |
{ |
{ |
|
hThreadCurrent = GetCurrentThread(); |
|
|
|
|
| 35 |
out.Format("200 %s ready.",App_common::GetVersion()); |
out.Format("200 %s ready.",App_common::GetVersion()); |
| 36 |
this->s_send(out); |
this->s_send(out); |
| 37 |
while(!this->thread_terminate) |
while(!this->thread_terminate) |
| 38 |
{ |
{ |
| 39 |
this->GetParentThread()->GetThreadPool()->SetThreadStatus(hThreadCurrent,thread_pool::S_WAITING); |
this->GetParentThread()->GetThreadPool()->SetThreadStatus(GetCurrentThreadId(),thread_pool::S_WAITING); |
| 40 |
|
|
| 41 |
if (this->s_receive(out) == 0) //Connection closed |
if (this->s_receive(out) == 0) //Connection closed |
| 42 |
break; |
break; |
| 43 |
out.Trim(); |
out.Trim(); |
| 44 |
|
|
| 45 |
this->GetParentThread()->GetThreadPool()->SetThreadStatus(hThreadCurrent,thread_pool::S_WORKING); |
this->GetParentThread()->GetThreadPool()->SetThreadStatus(GetCurrentThreadId(),thread_pool::S_WORKING); |
| 46 |
|
|
| 47 |
syslog << logfile::log_head << "Cmd: " << out << endl; |
syslog << logfile::log_head << "Cmd: " << out << endl; |
| 48 |
|
|
| 120 |
} |
} |
| 121 |
catch(CException* e) |
catch(CException* e) |
| 122 |
{ |
{ |
| 123 |
syslog << logfile::log_head << "Error in accept()" << endl; |
char strErrMsg[1024]; |
| 124 |
|
e->GetErrorMessage(strErrMsg,1024); |
| 125 |
|
syslog << logfile::log_head << "Error in accept() [" << strErrMsg << "]" << endl; |
| 126 |
e->Delete(); |
e->Delete(); |
| 127 |
return -1; |
return -1; |
| 128 |
} |
} |
| 154 |
|
|
| 155 |
sql = "select * from innd_conf order by `group`"; |
sql = "select * from innd_conf order by `group`"; |
| 156 |
|
|
| 157 |
RS.Open(CRecordset::snapshot,sql,CRecordst::forwardOnly | CRecordset::readOnly); |
RS.Open(CRecordset::snapshot,sql,CRecordset::forwardOnly | CRecordset::readOnly); |
| 158 |
while(!RS.IsEEOF()) |
while(!RS.IsEOF()) |
| 159 |
{ |
{ |
| 160 |
RS.GetFieldValue("group",dbVar,SQL_C_CHAR); |
RS.GetFieldValue("group",dbVar,SQL_C_CHAR); |
| 161 |
group = *(dbVr.m_pstring); |
group = *(dbVar.m_pstring); |
| 162 |
art_begin = 1; |
art_begin = 1; |
| 163 |
art_end = 0;; |
art_end = 0;; |
| 164 |
RS.GetFieldValue("in",dbVar,SQL_C_SSHORT); |
RS.GetFieldValue("in",dbVar,SQL_C_SSHORT); |
| 173 |
} |
} |
| 174 |
catch(CException* e) |
catch(CException* e) |
| 175 |
{ |
{ |
| 176 |
syslog << logfile::log_head << "Error in cmd_list()" << endl; |
char strErrMsg[1024]; |
| 177 |
|
e->GetErrorMessage(strErrMsg,1024); |
| 178 |
|
syslog << logfile::log_head << "Error in cmd_list() [" << strErrMsg << "]" << endl; |
| 179 |
e->Delete(); |
e->Delete(); |
| 180 |
return -1; |
return -1; |
| 181 |
} |
} |
| 316 |
if (strcmp(cmd,"cancel")==0 && strcmp(cancel_msg_id,"")!=0) //Empty Message-ID |
if (strcmp(cmd,"cancel")==0 && strcmp(cancel_msg_id,"")!=0) //Empty Message-ID |
| 317 |
{ |
{ |
| 318 |
//Delete article |
//Delete article |
| 319 |
sql.Format("select AID from innd_logfile where msg_id='%s'" |
sql.Format("select AID from innd_log where msg_id='%s'" |
| 320 |
" and op='I' and cancel=0",base::addslashes(cancel_msg_id)); |
" and op='I' and cancel=0",base::addslashes(cancel_msg_id)); |
| 321 |
|
|
| 322 |
RS.Open(CRecordset::snapshot,sql,CRecordset::forwardOnly | CRecordset::readOnly); |
RS.Open(CRecordset::snapshot,sql,CRecordset::forwardOnly | CRecordset::readOnly); |
| 355 |
} |
} |
| 356 |
catch(CException* e) |
catch(CException* e) |
| 357 |
{ |
{ |
| 358 |
syslog << logfile::log_head << "Error in cmd_ihave()" << endl; |
char strErrMsg[1024]; |
| 359 |
|
e->GetErrorMessage(strErrMsg,1024); |
| 360 |
|
syslog << logfile::log_head << "Error in cmd_ihave() [" << strErrMsg << "]" << endl; |
| 361 |
e->Delete(); |
e->Delete(); |
| 362 |
return -1; |
return -1; |
| 363 |
} |
} |
| 398 |
} |
} |
| 399 |
return 0; |
return 0; |
| 400 |
} |
} |
| 401 |
|
|
| 402 |
|
bool innd::check_priv(void) |
| 403 |
|
{ |
| 404 |
|
return this->access.get; |
| 405 |
|
} |