Skip to content

Commit

Permalink
log: optimize log
Browse files Browse the repository at this point in the history
  • Loading branch information
pymumu committed Jan 2, 2023
1 parent 98ce7fd commit d792e5f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/dns_client.c
Original file line number Diff line number Diff line change
Expand Up @@ -2308,16 +2308,17 @@ static int _dns_client_process_tcp(struct dns_server_info *server_info, struct e
len = _dns_client_socket_recv(server_info);
if (len < 0) {
/* no data to recv, try again */
if (errno == EAGAIN) {
if (errno == EAGAIN || errno == EWOULDBLOCK) {
return 0;
}

/* FOR GFW */
if (errno == ECONNRESET) {
if (errno == ECONNRESET || errno == ENETUNREACH || errno == EHOSTUNREACH) {
tlog(TLOG_DEBUG, "recv failed, server %s:%d, %s\n", server_info->ip, server_info->port,
strerror(errno));
goto errout;
}

if (errno == ETIMEDOUT) {
if (errno == ETIMEDOUT || errno == ECONNREFUSED) {
tlog(TLOG_INFO, "recv failed, server %s:%d, %s\n", server_info->ip, server_info->port, strerror(errno));
goto errout;
}
Expand Down

0 comments on commit d792e5f

Please sign in to comment.