simplify some codes

This commit is contained in:
XieHan
2021-09-20 02:15:39 +08:00
parent 1dab1aa676
commit 8848fb5e12
2 changed files with 7 additions and 15 deletions
+7 -12
View File
@@ -977,27 +977,22 @@ CommMessageOut *WFHttpServerTask::message_out()
}
if (this->keep_alive_timeo == 0)
if (!resp_has_connection)
{
if (!resp_has_connection)
header.name = "Connection";
header.name_len = 10;
if (this->keep_alive_timeo == 0)
{
header.name = "Connection";
header.name_len = 10;
header.value = "close";
header.value_len = 5;
resp->add_header(&header);
}
}
else
{
if (!resp_has_connection)
else
{
header.name = "Connection";
header.name_len = 10;
header.value = "Keep-Alive";
header.value_len = 10;
resp->add_header(&header);
}
resp->add_header(&header);
}
return this->WFServerTask::message_out();
-3
View File
@@ -576,10 +576,7 @@ bool ComplexMySQLTask::init_success()
this->set_fixed_addr(true);
}
else
{
this->WFComplexClientTask::set_info(info);
this->set_fixed_addr(false);
}
delete []info;
return true;