| 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 |
|
|
| 11 |
#include "StdAfx.h" |
#include "StdAfx.h" |
| 12 |
#include ".\bbsd.h" |
#include ".\bbsd.h" |
| 13 |
#include ".\nntp_active.h" |
#include ".\base_active.h" |
| 14 |
|
|
| 15 |
using namespace std; |
using namespace std; |
| 16 |
|
|
| 35 |
try |
try |
| 36 |
{ |
{ |
| 37 |
u_online = 0; |
u_online = 0; |
| 38 |
sql = "select SID as cc from user_online group by SID"; |
sql = "select SID as cc from user_online where current_action not in" |
| 39 |
|
" ('max_user_limit','max_ip_limit','max_session_limit','exit')" |
| 40 |
|
" group by SID"; |
| 41 |
RS.Open(CRecordset::snapshot,sql,CRecordset::forwardOnly | CRecordset::readOnly); |
RS.Open(CRecordset::snapshot,sql,CRecordset::forwardOnly | CRecordset::readOnly); |
| 42 |
while(!RS.IsEOF()) |
while(!RS.IsEOF()) |
| 43 |
{ |
{ |
| 47 |
RS.Close(); |
RS.Close(); |
| 48 |
|
|
| 49 |
u_anonymous = 0; |
u_anonymous = 0; |
| 50 |
sql = "select SID as cc from user_online where UID=0 group by SID"; |
sql = "select SID as cc from user_online where UID=0 and current_action not in" |
| 51 |
|
" ('max_user_limit','max_ip_limit','max_session_limit','exit')" |
| 52 |
|
" group by SID"; |
| 53 |
RS.Open(CRecordset::snapshot,sql,CRecordset::forwardOnly | CRecordset::readOnly); |
RS.Open(CRecordset::snapshot,sql,CRecordset::forwardOnly | CRecordset::readOnly); |
| 54 |
while(!RS.IsEOF()) |
while(!RS.IsEOF()) |
| 55 |
{ |
{ |
| 78 |
"注册用户数[\033[36m%ld\033[32m]\r\n" |
"注册用户数[\033[36m%ld\033[32m]\r\n" |
| 79 |
"\033[1;37m本站目前尚未开设telnet服务 请使用Web方式访问\r\n\r\n" |
"\033[1;37m本站目前尚未开设telnet服务 请使用Web方式访问\r\n\r\n" |
| 80 |
"\033[1;32m http://%s \033[m\r\n", |
"\033[1;32m http://%s \033[m\r\n", |
| 81 |
this->innd_name,u_online,MAX_THREAD,u_anonymous,u_total, |
this->innd_name,u_online,MAX_CLIENT,u_anonymous,u_total, |
| 82 |
this->innd_server,this->innd_server); |
this->innd_server,this->innd_server); |
| 83 |
|
|
| 84 |
this->s_send(out); |
this->s_send(out); |
| 85 |
while(!this->thread_terminate) |
while(!this->thread_terminate) |
| 86 |
{ |
{ |
| 87 |
|
this->GetParentThread()->GetThreadPool()->SetThreadStatus(GetCurrentThreadId(),thread_pool::S_WAITING); |
| 88 |
|
|
| 89 |
if (this->s_receive(out) == 0) //Connection closed |
if (this->s_receive(out) == 0) //Connection closed |
| 90 |
break; |
break; |
| 91 |
out.Trim(); |
out.Trim(); |
| 92 |
|
|
| 93 |
|
this->GetParentThread()->GetThreadPool()->SetThreadStatus(GetCurrentThreadId(),thread_pool::S_WORKING); |
| 94 |
|
|
| 95 |
if (sscanf(out,"%20s",temp) ==1) |
if (sscanf(out,"%20s",temp) ==1) |
| 96 |
cmd = strupr(temp); |
cmd = strupr(temp); |
| 97 |
else |
else |
| 112 |
} |
} |
| 113 |
catch(CException* e) |
catch(CException* e) |
| 114 |
{ |
{ |
| 115 |
syslog << logfile::log_head << "Error in accept()" << endl; |
char strErrMsg[1024]; |
| 116 |
|
e->GetErrorMessage(strErrMsg,1024); |
| 117 |
|
syslog << logfile::log_head << "Error in accept() [" << strErrMsg << "]" << endl; |
| 118 |
e->Delete(); |
e->Delete(); |
| 119 |
return -1; |
return -1; |
| 120 |
} |
} |
| 134 |
|
|
| 135 |
int bbsd::Shutdown(void) |
int bbsd::Shutdown(void) |
| 136 |
{ |
{ |
| 137 |
nntp_active nntpClient; |
base_active nntpClient; |
| 138 |
|
|
| 139 |
if (this->thread_terminate) |
if (this->thread_terminate) |
| 140 |
return 1; |
return 1; |
| 165 |
} |
} |
| 166 |
return 0; |
return 0; |
| 167 |
} |
} |
| 168 |
|
|
| 169 |
|
bool bbsd::check_priv(void) |
| 170 |
|
{ |
| 171 |
|
return true; |
| 172 |
|
} |