dns_server: suppress some error log

This commit is contained in:
Nick Peng
2023-11-19 09:40:46 +08:00
parent 48ef6f2547
commit 26798f8f1a
2 changed files with 9 additions and 5 deletions

View File

@@ -1798,7 +1798,7 @@ static int _dns_client_create_socket_udp_proxy(struct dns_server_info *server_in
}
set_fd_nonblock(fd, 1);
set_sock_keepalive(fd, 15, 3, 4);
set_sock_keepalive(fd, 30, 3, 5);
ret = proxy_conn_connect(proxy);
if (ret != 0) {
@@ -1949,7 +1949,7 @@ static int _DNS_client_create_socket_tcp(struct dns_server_info *server_info)
setsockopt(fd, IPPROTO_IP, IP_TOS, &ip_tos, sizeof(ip_tos));
setsockopt(fd, IPPROTO_TCP, TCP_THIN_DUPACK, &yes, sizeof(yes));
setsockopt(fd, IPPROTO_TCP, TCP_THIN_LINEAR_TIMEOUTS, &yes, sizeof(yes));
set_sock_keepalive(fd, 15, 3, 4);
set_sock_keepalive(fd, 30, 3, 5);
if (proxy) {
ret = proxy_conn_connect(proxy);
@@ -2056,7 +2056,7 @@ static int _DNS_client_create_socket_tls(struct dns_server_info *server_info, ch
setsockopt(fd, IPPROTO_TCP, TCP_NODELAY, &yes, sizeof(yes));
setsockopt(fd, IPPROTO_TCP, TCP_THIN_DUPACK, &yes, sizeof(yes));
setsockopt(fd, IPPROTO_TCP, TCP_THIN_LINEAR_TIMEOUTS, &yes, sizeof(yes));
set_sock_keepalive(fd, 15, 3, 4);
set_sock_keepalive(fd, 30, 3, 5);
setsockopt(fd, SOL_SOCKET, SO_PRIORITY, &priority, sizeof(priority));
setsockopt(fd, IPPROTO_IP, IP_TOS, &ip_tos, sizeof(ip_tos));

View File

@@ -5972,7 +5972,7 @@ static int _dns_server_tcp_accept(struct dns_server_conn_tcp_server *tcpserver,
list_add(&tcpclient->head.list, &server.conn_list);
_dns_server_conn_get(&tcpclient->head);
set_sock_keepalive(fd, 15, 3, 4);
set_sock_keepalive(fd, 30, 3, 5);
return 0;
errout:
@@ -6209,6 +6209,10 @@ static int _dns_server_tcp_recv(struct dns_server_conn_tcp_client *tcpclient)
return RECV_ERROR_CLOSE;
}
if (errno == ETIMEDOUT) {
return RECV_ERROR_CLOSE;
}
tlog(TLOG_ERROR, "recv failed, %s\n", strerror(errno));
return RECV_ERROR_FAIL;
} else if (len == 0) {
@@ -6496,7 +6500,7 @@ static int _dns_server_tls_accept(struct dns_server_conn_tls_server *tls_server,
list_add(&tls_client->tcp.head.list, &server.conn_list);
_dns_server_conn_get(&tls_client->tcp.head);
set_sock_keepalive(fd, 15, 3, 4);
set_sock_keepalive(fd, 30, 3, 5);
return 0;
errout: