Compare commits

..

2 Commits

Author SHA1 Message Date
Nick Peng
2ca4c92c9f dns-client: allow same upstream server with different proxy. 2023-02-22 21:55:07 +08:00
Nick Peng
e3271b07c4 tlog: update tlog 2023-02-22 21:54:16 +08:00
2 changed files with 7 additions and 3 deletions

View File

@@ -447,7 +447,7 @@ errout:
}
/* check whether server exists */
static int _dns_client_server_exist(const char *server_ip, int port, dns_server_type_t server_type)
static int _dns_client_server_exist(const char *server_ip, int port, dns_server_type_t server_type, struct client_dns_server_flags *flags)
{
struct dns_server_info *server_info = NULL;
struct dns_server_info *tmp = NULL;
@@ -458,6 +458,10 @@ static int _dns_client_server_exist(const char *server_ip, int port, dns_server_
continue;
}
if (memcmp(&server_info->flags, flags, sizeof(*flags)) == 0) {
continue;
}
if (strncmp(server_info->ip, server_ip, DNS_HOSTNAME_LEN) != 0) {
continue;
}
@@ -1029,7 +1033,7 @@ static int _dns_client_server_add(char *server_ip, char *server_host, int port,
}
/* if server exist, return */
if (_dns_client_server_exist(server_ip, port, server_type) == 0) {
if (_dns_client_server_exist(server_ip, port, server_type, flags) == 0) {
return 0;
}

View File

@@ -1050,7 +1050,7 @@ static int _tlog_archive_log_compressed(struct tlog_log *log)
int pid = vfork();
if (pid == 0) {
_tlog_close_all_fd();
execl(tlog.gzip_cmd, "-1", pending_file, NULL);
execl(tlog.gzip_cmd, tlog.gzip_cmd, "-1", pending_file, NULL);
_exit(1);
} else if (pid < 0) {
goto errout;