Merge pull request #1150 from Barenboim/master

Make DNS request id more random.
This commit is contained in:
xiehan
2023-01-13 18:54:36 +08:00
committed by GitHub
2 changed files with 2 additions and 11 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ set(CMAKE_SKIP_RPATH TRUE)
project(
workflow
VERSION 0.10.5
VERSION 0.10.6
LANGUAGES C CXX
)
+1 -10
View File
@@ -41,7 +41,6 @@ public:
protected:
virtual CommMessageOut *message_out();
virtual int keep_alive_timeout();
virtual bool init_success();
virtual bool finish_once();
@@ -63,7 +62,7 @@ CommMessageOut *ComplexDnsTask::message_out()
TransportType type = this->get_transport_type();
if (req->get_id() == 0)
req->set_id(this->get_task_seq() + 1);
req->set_id((this->get_task_seq() + 1) * 99991 % 65535 + 1);
resp->set_request_id(req->get_id());
resp->set_request_name(req->get_question_name());
req->set_single_packet(type == TT_UDP);
@@ -72,14 +71,6 @@ CommMessageOut *ComplexDnsTask::message_out()
return this->WFClientTask::message_out();
}
int ComplexDnsTask::keep_alive_timeout()
{
if (this->get_task_seq() == (1 << 16) - 2)
return 0;
return this->WFClientTask::keep_alive_timeout();
}
bool ComplexDnsTask::init_success()
{
if (uri_.scheme && strcasecmp(uri_.scheme, "dnss") == 0)