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

Diff of /innwebd/bbsd.cpp

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

Revision 1.4 by sysadm, Sat Jul 3 13:56:04 2004 UTC Revision 1.9 by sysadm, Fri Apr 11 17:14:49 2008 UTC
# Line 1  Line 1 
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    
# Line 34  int bbsd::Accept(void) Line 30  int bbsd::Accept(void)
30          CDBVariant dbVar;          CDBVariant dbVar;
31          CString sql,out,cmd;          CString sql,out,cmd;
32          char temp[256];          char temp[256];
         HANDLE hThreadCurrent;  
33          long u_online,u_anonymous,u_total;          long u_online,u_anonymous,u_total;
34    
35          try          try
36          {          {
                 hThreadCurrent = GetCurrentThread();  
   
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                  {                  {
# Line 52  int bbsd::Accept(void) Line 47  int bbsd::Accept(void)
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                  {                  {
# Line 87  int bbsd::Accept(void) Line 84  int bbsd::Accept(void)
84                  this->s_send(out);                  this->s_send(out);
85                  while(!this->thread_terminate)                  while(!this->thread_terminate)
86                  {                  {
87                          this->GetParentThread()->GetThreadPool()->SetThreadStatus(hThreadCurrent,thread_pool::S_WAITING);                          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(hThreadCurrent,thread_pool::S_WORKING);                          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);
# Line 115  int bbsd::Accept(void) Line 112  int bbsd::Accept(void)
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          }          }
# Line 166  int bbsd::db_env_init(void) Line 165  int bbsd::db_env_init(void)
165          }          }
166          return 0;          return 0;
167  }  }
168    
169    bool bbsd::check_priv(void)
170    {
171            return true;
172    }


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

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