Skip to content

Commit

Permalink
🐛 fix bug
Browse files Browse the repository at this point in the history
  • Loading branch information
markparticle committed Jun 30, 2020
1 parent 1485200 commit 24a51da
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 90 deletions.
1 change: 0 additions & 1 deletion build/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
#heaptimer.cpp
CXX = g++
CFLAGS = -std=c++14 -O2 -Wall -g

Expand Down
3 changes: 2 additions & 1 deletion code/http/httprequest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ bool HttpRequest::UserVerify(const string &name, const string &pwd, bool isLogin
LOG_INFO("Verify name:%s pwd:%s", name.c_str(), pwd.c_str());
MYSQL* sql;
SqlConnRAII(&sql, SqlConnPool::Instance());

assert(sql);

bool flag = false;
unsigned int j = 0;
char order[256] = { 0 };
Expand Down
2 changes: 0 additions & 2 deletions code/http/httpresponse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,12 @@ const unordered_map<int, string> HttpResponse::CODE_STATUS = {
{ 400, "Bad Request" },
{ 403, "Forbidden" },
{ 404, "Not Found" },
{ 500, "Internal Error" },
};

const unordered_map<int, string> HttpResponse::CODE_PATH = {
{ 400, "/400.html" },
{ 403, "/403.html" },
{ 404, "/404.html" },
{ 500, "/500.html" },
};

HttpResponse::HttpResponse() {
Expand Down
2 changes: 1 addition & 1 deletion code/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ int main() {
WebServer server(
1316, 3, 5000, true, false, /* 端口 ET模式 timeoutMs Proactor/Reactor(使用异步线程池) 优雅退出 */
3306, "root", "root", "webserver", /* Mysql配置 */
100, 6, false, 0, 0); /* 连接池数量 线程池数量 日志开关 日志等级 日志异步队列容量 */
100, 6, true, 0, 0); /* 连接池数量 线程池数量 日志开关 日志等级 日志异步队列容量 */
server.Start();
}

1 change: 1 addition & 0 deletions code/pool/sqlconnpool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ void SqlConnPool::Init(const char* host, int port,
sql = mysql_init(sql);
if (!sql) {
LOG_ERROR("MySql init error!");
assert(sql);
}
sql = mysql_real_connect(sql, host,
user, pwd,
Expand Down
85 changes: 0 additions & 85 deletions resources/500.html

This file was deleted.

0 comments on commit 24a51da

Please sign in to comment.