diff --git a/code/http/httprequest.cpp b/code/http/httprequest.cpp index 69bfbb1e..c12768d9 100644 --- a/code/http/httprequest.cpp +++ b/code/http/httprequest.cpp @@ -228,9 +228,10 @@ bool HttpRequest::UserVerify(const string &name, const string &pwd, bool isLogin LOG_DEBUG( "Insert error!"); flag = false; } - flag = true; + else flag = true; } - SqlConnPool::Instance()->FreeConn(sql); + // RAII机制自动释放 + // SqlConnPool::Instance()->FreeConn(sql); LOG_DEBUG( "UserVerify success!!"); return flag; } @@ -264,4 +265,4 @@ std::string HttpRequest::GetPost(const char* key) const { return post_.find(key)->second; } return ""; -} \ No newline at end of file +}