Skip to content

Commit

Permalink
Add DNS resolution log
Browse files Browse the repository at this point in the history
  • Loading branch information
GreaterFire committed Sep 30, 2019
1 parent 33b6b6b commit 967bcb4
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/session/clientsession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ void ClientSession::in_sent() {
return;
}
auto iterator = results.begin();
Log::log_with_endpoint(in_endpoint, config.remote_addr + " is resolved to " + iterator->endpoint().address().to_string(), Log::ALL);
boost::system::error_code ec;
out_socket.next_layer().open(iterator->endpoint().protocol(), ec);
if (ec) {
Expand Down
1 change: 1 addition & 0 deletions src/session/forwardsession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ void ForwardSession::start() {
return;
}
auto iterator = results.begin();
Log::log_with_endpoint(in_endpoint, config.remote_addr + " is resolved to " + iterator->endpoint().address().to_string(), Log::ALL);
boost::system::error_code ec;
out_socket.next_layer().open(iterator->endpoint().protocol(), ec);
if (ec) {
Expand Down
1 change: 1 addition & 0 deletions src/session/natsession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ void NATSession::start() {
return;
}
auto iterator = results.begin();
Log::log_with_endpoint(in_endpoint, config.remote_addr + " is resolved to " + iterator->endpoint().address().to_string(), Log::ALL);
boost::system::error_code ec;
out_socket.next_layer().open(iterator->endpoint().protocol(), ec);
if (ec) {
Expand Down
2 changes: 2 additions & 0 deletions src/session/serversession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ void ServerSession::in_recv(const string &data) {
}
}
}
Log::log_with_endpoint(in_endpoint, query_addr + " is resolved to " + iterator->endpoint().address().to_string(), Log::ALL);
boost::system::error_code ec;
out_socket.open(iterator->endpoint().protocol(), ec);
if (ec) {
Expand Down Expand Up @@ -294,6 +295,7 @@ void ServerSession::udp_sent() {
}
}
}
Log::log_with_endpoint(in_endpoint, query_addr + " is resolved to " + iterator->endpoint().address().to_string(), Log::ALL);
if (!udp_socket.is_open()) {
auto protocol = iterator->endpoint().protocol();
boost::system::error_code ec;
Expand Down
1 change: 1 addition & 0 deletions src/session/udpforwardsession.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ void UDPForwardSession::start() {
return;
}
auto iterator = results.begin();
Log::log_with_endpoint(in_endpoint, config.remote_addr + " is resolved to " + iterator->endpoint().address().to_string(), Log::ALL);
boost::system::error_code ec;
out_socket.next_layer().open(iterator->endpoint().protocol(), ec);
if (ec) {
Expand Down

0 comments on commit 967bcb4

Please sign in to comment.