优化
This commit is contained in:
@@ -64,7 +64,7 @@ namespace ylib
|
||||
/// [测试] 生成GUID
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
std::string test_make_guid();
|
||||
//std::string test_make_guid();
|
||||
private:
|
||||
// 目录
|
||||
std::string m_dirpath;
|
||||
|
||||
@@ -220,7 +220,15 @@ void ylib::network::http::router::__thread_callback(reqpack* rp)
|
||||
if(execed == false){
|
||||
//其它回调
|
||||
if (m_callback_other != nullptr) {
|
||||
m_callback_other(rp->request(), rp->response());
|
||||
try
|
||||
{
|
||||
m_callback_other(rp->request(), rp->response());
|
||||
}
|
||||
catch (const std::exception& e)
|
||||
{
|
||||
rp->response()->send((std::string)e.what(), 500, "Internal Server Error");
|
||||
}
|
||||
|
||||
}else{
|
||||
rp->response()->send((std::string)"Services that have not been processed",500,"Service Unavailable");
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ bool ylib::local_storage::exist(const std::string& name)
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string ylib::local_storage::test_make_guid()
|
||||
{
|
||||
return codec::md5(std::to_string(time::now_msec()) + std::to_string(m_guid_counter.make()));
|
||||
}
|
||||
//std::string ylib::local_storage::test_make_guid()
|
||||
//{
|
||||
// return codec::md5(std::to_string(time::now_msec()) + std::to_string(m_guid_counter.make()));
|
||||
//}
|
||||
|
||||
Reference in New Issue
Block a user