--- innwebd/base.cpp 2004/08/02 19:47:45 1.7 +++ innwebd/base.cpp 2004/08/28 15:38:42 1.9 @@ -36,7 +36,7 @@ base::~base(void) delete (this->GetThreadPool()); } -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[]) { try{ if (in_str != NULL) @@ -283,7 +283,7 @@ int base::bbs_post(const CString& head, "]¿´¿´[/url]¡¶%s¡·°É£¡\n",rid,addslashes(subject)); RS.GetFieldValue("UID",dbVar,SQL_C_SLONG); - 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)" " values(%ld,%ld,'%s',now(),'%s')", this->innd_uid,dbVar.m_lVal,addslashes(msg_content),this->hostaddr); this->Db.ExecuteSQL(sql); @@ -430,7 +430,7 @@ int base::s_send(const char* in_str, boo return 0; } -int base::s_receive(CString& out_str, const char* end_str) +int base::s_receive(CString& out_str, char end_str[]) { char buf_str[2048]; int buf_read,total_read; @@ -449,6 +449,12 @@ int base::s_receive(CString& out_str, co out_str += buf_str; if (out_str.Right((int)strlen(end_str)) == end_str) break; + //different line-end symbol in different OS + if (strcmp(end_str,"\r") == 0) + { + if (out_str.Right(2) == "\r\n") + break; + } } } catch(CException* e)