Skip to content

Commit 77c363d

Browse files
authored
Merge pull request #20 from markparticle/dev_mark
🐛 fix bug
2 parents 13e6355 + 24a51da commit 77c363d

File tree

6 files changed

+4
-90
lines changed

6 files changed

+4
-90
lines changed

build/Makefile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
#heaptimer.cpp
21
CXX = g++
32
CFLAGS = -std=c++14 -O2 -Wall -g
43

code/http/httprequest.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,8 @@ bool HttpRequest::UserVerify(const string &name, const string &pwd, bool isLogin
180180
LOG_INFO("Verify name:%s pwd:%s", name.c_str(), pwd.c_str());
181181
MYSQL* sql;
182182
SqlConnRAII(&sql, SqlConnPool::Instance());
183-
183+
assert(sql);
184+
184185
bool flag = false;
185186
unsigned int j = 0;
186187
char order[256] = { 0 };

code/http/httpresponse.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,12 @@ const unordered_map<int, string> HttpResponse::CODE_STATUS = {
3333
{ 400, "Bad Request" },
3434
{ 403, "Forbidden" },
3535
{ 404, "Not Found" },
36-
{ 500, "Internal Error" },
3736
};
3837

3938
const unordered_map<int, string> HttpResponse::CODE_PATH = {
4039
{ 400, "/400.html" },
4140
{ 403, "/403.html" },
4241
{ 404, "/404.html" },
43-
{ 500, "/500.html" },
4442
};
4543

4644
HttpResponse::HttpResponse() {

code/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ int main() {
1212
WebServer server(
1313
1316, 3, 5000, true, false, /* 端口 ET模式 timeoutMs Proactor/Reactor(使用异步线程池) 优雅退出 */
1414
3306, "root", "root", "webserver", /* Mysql配置 */
15-
100, 6, false, 0, 0); /* 连接池数量 线程池数量 日志开关 日志等级 日志异步队列容量 */
15+
100, 6, true, 0, 0); /* 连接池数量 线程池数量 日志开关 日志等级 日志异步队列容量 */
1616
server.Start();
1717
}
1818

code/pool/sqlconnpool.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ void SqlConnPool::Init(const char* host, int port,
2626
sql = mysql_init(sql);
2727
if (!sql) {
2828
LOG_ERROR("MySql init error!");
29+
assert(sql);
2930
}
3031
sql = mysql_real_connect(sql, host,
3132
user, pwd,

resources/500.html

Lines changed: 0 additions & 85 deletions
This file was deleted.

0 commit comments

Comments
 (0)