Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix unreasonable function name #87

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions timer/lst_timer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ void sort_timer_lst::del_timer(util_timer *timer)
if ((timer == head) && (timer == tail))
{
delete timer;
timer = nullptr;
head = NULL;
tail = NULL;
return;
Expand All @@ -80,18 +81,21 @@ void sort_timer_lst::del_timer(util_timer *timer)
head = head->next;
head->prev = NULL;
delete timer;
timer = nullptr;
return;
}
if (timer == tail)
{
tail = tail->prev;
tail->next = NULL;
delete timer;
timer = nullptr;
return;
}
timer->prev->next = timer->next;
timer->next->prev = timer->prev;
delete timer;
timer = nullptr;
}
void sort_timer_lst::tick()
{
Expand Down
4 changes: 2 additions & 2 deletions webserver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ void WebServer::deal_timer(util_timer *timer, int sockfd)
LOG_INFO("close fd %d", users_timer[sockfd].sockfd);
}

bool WebServer::dealclinetdata()
bool WebServer::dealclientdata()
{
struct sockaddr_in client_address;
socklen_t client_addrlength = sizeof(client_address);
Expand Down Expand Up @@ -395,7 +395,7 @@ void WebServer::eventLoop()
//处理新到的客户连接
if (sockfd == m_listenfd)
{
bool flag = dealclinetdata();
bool flag = dealclientdata();
if (false == flag)
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion webserver.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class WebServer
void timer(int connfd, struct sockaddr_in client_address);
void adjust_timer(util_timer *timer);
void deal_timer(util_timer *timer, int sockfd);
bool dealclinetdata();
bool dealclientdata();
bool dealwithsignal(bool& timeout, bool& stop_server);
void dealwithread(int sockfd);
void dealwithwrite(int sockfd);
Expand Down