| 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) |
| 236 |
this->Db.ExecuteSQL(sql); //7671 |
this->Db.ExecuteSQL(sql); //7671 |
| 237 |
|
|
| 238 |
//Add logfile |
//Add logfile |
| 239 |
sql.Format("insert delayed into bbs_article_op(AID,UID,type,op_dt,op_ip,complete)" |
sql.Format("insert delayed into bbs_article_op(AID,UID,type,op_dt,op_ip)" |
| 240 |
" values(%ld,%ld,'I',now(),'%s',1)", |
" values(%ld,%ld,'I',now(),'%s')", |
| 241 |
aid,this->innd_uid,this->hostaddr); |
aid,this->innd_uid,this->hostaddr); |
| 242 |
this->Db.ExecuteSQL(sql); |
this->Db.ExecuteSQL(sql); |
| 243 |
|
|
| 379 |
this->Db.ExecuteSQL(sql); |
this->Db.ExecuteSQL(sql); |
| 380 |
|
|
| 381 |
//Add logfile |
//Add logfile |
| 382 |
sql.Format("insert delayed into bbs_article_op(AID,UID,type,op_dt," |
sql.Format("insert delayed into bbs_article_op(AID,UID,type,op_dt,op_ip)" |
| 383 |
"op_ip,complete) values(%ld,%ld,'C',now(),'%s',1)", |
" values(%ld,%ld,'C',now(),'%s')", |
| 384 |
id,innd_uid,this->hostaddr); |
id,innd_uid,this->hostaddr); |
| 385 |
this->Db.ExecuteSQL(sql); |
this->Db.ExecuteSQL(sql); |
| 386 |
|
|
| 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; |
| 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) |