Skip to content

Commit 967bcb4

Browse files
committed
Add DNS resolution log
1 parent 33b6b6b commit 967bcb4

File tree

5 files changed

+6
-0
lines changed

5 files changed

+6
-0
lines changed

src/session/clientsession.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ void ClientSession::in_sent() {
229229
return;
230230
}
231231
auto iterator = results.begin();
232+
Log::log_with_endpoint(in_endpoint, config.remote_addr + " is resolved to " + iterator->endpoint().address().to_string(), Log::ALL);
232233
boost::system::error_code ec;
233234
out_socket.next_layer().open(iterator->endpoint().protocol(), ec);
234235
if (ec) {

src/session/forwardsession.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ void ForwardSession::start() {
6464
return;
6565
}
6666
auto iterator = results.begin();
67+
Log::log_with_endpoint(in_endpoint, config.remote_addr + " is resolved to " + iterator->endpoint().address().to_string(), Log::ALL);
6768
boost::system::error_code ec;
6869
out_socket.next_layer().open(iterator->endpoint().protocol(), ec);
6970
if (ec) {

src/session/natsession.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ void NATSession::start() {
112112
return;
113113
}
114114
auto iterator = results.begin();
115+
Log::log_with_endpoint(in_endpoint, config.remote_addr + " is resolved to " + iterator->endpoint().address().to_string(), Log::ALL);
115116
boost::system::error_code ec;
116117
out_socket.next_layer().open(iterator->endpoint().protocol(), ec);
117118
if (ec) {

src/session/serversession.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ void ServerSession::in_recv(const string &data) {
187187
}
188188
}
189189
}
190+
Log::log_with_endpoint(in_endpoint, query_addr + " is resolved to " + iterator->endpoint().address().to_string(), Log::ALL);
190191
boost::system::error_code ec;
191192
out_socket.open(iterator->endpoint().protocol(), ec);
192193
if (ec) {
@@ -294,6 +295,7 @@ void ServerSession::udp_sent() {
294295
}
295296
}
296297
}
298+
Log::log_with_endpoint(in_endpoint, query_addr + " is resolved to " + iterator->endpoint().address().to_string(), Log::ALL);
297299
if (!udp_socket.is_open()) {
298300
auto protocol = iterator->endpoint().protocol();
299301
boost::system::error_code ec;

src/session/udpforwardsession.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ void UDPForwardSession::start() {
6363
return;
6464
}
6565
auto iterator = results.begin();
66+
Log::log_with_endpoint(in_endpoint, config.remote_addr + " is resolved to " + iterator->endpoint().address().to_string(), Log::ALL);
6667
boost::system::error_code ec;
6768
out_socket.next_layer().open(iterator->endpoint().protocol(), ec);
6869
if (ec) {

0 commit comments

Comments
 (0)