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

Diff of /innwebd/base.cpp

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

Revision 1.7 by sysadm, Mon Aug 2 19:47:45 2004 UTC Revision 1.9 by sysadm, Sat Aug 28 15:38:42 2004 UTC
# Line 36  base::~base(void) Line 36  base::~base(void)
36                  delete (this->GetThreadPool());                  delete (this->GetThreadPool());
37  }  }
38    
39  int base::s_exec(const char* in_str, CString& out_str, const char* end_str)  int base::s_exec(const char* in_str, CString& out_str, char end_str[])
40  {  {
41          try{          try{
42                  if (in_str != NULL)                  if (in_str != NULL)
# Line 283  int base::bbs_post(const CString& head, Line 283  int base::bbs_post(const CString& head,
283                                                          "]¿´¿´[/url]¡¶%s¡·°É£¡\n",rid,addslashes(subject));                                                          "]¿´¿´[/url]¡¶%s¡·°É£¡\n",rid,addslashes(subject));
284    
285                                                  RS.GetFieldValue("UID",dbVar,SQL_C_SLONG);                                                  RS.GetFieldValue("UID",dbVar,SQL_C_SLONG);
286                                                  sql.Format("insert into bbs_msg(fromUID,toUID,ntent,send_dt,send_ip)"                                                  sql.Format("insert into bbs_msg(fromUID,toUID,content,send_dt,send_ip)"
287                                                                  " values(%ld,%ld,'%s',now(),'%s')",                                                                  " values(%ld,%ld,'%s',now(),'%s')",
288                                                                  this->innd_uid,dbVar.m_lVal,addslashes(msg_content),this->hostaddr);                                                                  this->innd_uid,dbVar.m_lVal,addslashes(msg_content),this->hostaddr);
289                                                  this->Db.ExecuteSQL(sql);                                                  this->Db.ExecuteSQL(sql);
# Line 430  int base::s_send(const char* in_str, boo Line 430  int base::s_send(const char* in_str, boo
430          return 0;          return 0;
431  }  }
432    
433  int base::s_receive(CString& out_str, const char* end_str)  int base::s_receive(CString& out_str, char end_str[])
434  {  {
435          char buf_str[2048];          char buf_str[2048];
436          int buf_read,total_read;          int buf_read,total_read;
# Line 449  int base::s_receive(CString& out_str, co Line 449  int base::s_receive(CString& out_str, co
449                          out_str += buf_str;                          out_str += buf_str;
450                          if (out_str.Right((int)strlen(end_str)) == end_str)                          if (out_str.Right((int)strlen(end_str)) == end_str)
451                                  break;                                  break;
452                            //different line-end symbol in different OS
453                            if (strcmp(end_str,"\r") == 0)
454                            {
455                                    if (out_str.Right(2) == "\r\n")
456                                            break;
457                            }
458                  }                  }
459          }          }
460          catch(CException* e)          catch(CException* e)


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

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