mirror of
https://frontier.innolan.net/rainlance/c-ares.git
synced 2026-03-17 15:41:58 +00:00
ares_set_servers_csv: remove unused variables
This commit is contained in:
@ -139,8 +139,6 @@ int ares_set_servers_csv(ares_channel channel,
|
|||||||
char* csv = NULL;
|
char* csv = NULL;
|
||||||
char* ptr;
|
char* ptr;
|
||||||
char* start_host;
|
char* start_host;
|
||||||
long port;
|
|
||||||
bool found_port;
|
|
||||||
int rv = ARES_SUCCESS;
|
int rv = ARES_SUCCESS;
|
||||||
struct ares_addr_node *servers = NULL;
|
struct ares_addr_node *servers = NULL;
|
||||||
struct ares_addr_node *last = NULL;
|
struct ares_addr_node *last = NULL;
|
||||||
@ -165,7 +163,6 @@ int ares_set_servers_csv(ares_channel channel,
|
|||||||
}
|
}
|
||||||
|
|
||||||
start_host = csv;
|
start_host = csv;
|
||||||
found_port = false;
|
|
||||||
for (ptr = csv; *ptr; ptr++) {
|
for (ptr = csv; *ptr; ptr++) {
|
||||||
if (*ptr == ',') {
|
if (*ptr == ',') {
|
||||||
char* pp = ptr - 1;
|
char* pp = ptr - 1;
|
||||||
@ -186,9 +183,8 @@ int ares_set_servers_csv(ares_channel channel,
|
|||||||
pp--;
|
pp--;
|
||||||
}
|
}
|
||||||
if ((pp != start_host) && ((pp + 1) < ptr)) {
|
if ((pp != start_host) && ((pp + 1) < ptr)) {
|
||||||
/* Found it. */
|
/* Found it. Parse over the port number */
|
||||||
found_port = true;
|
(void)strtol(pp + 1, NULL, 10);
|
||||||
port = strtol(pp + 1, NULL, 10);
|
|
||||||
*pp = 0; /* null terminate host */
|
*pp = 0; /* null terminate host */
|
||||||
}
|
}
|
||||||
/* resolve host, try ipv4 first, rslt is in network byte order */
|
/* resolve host, try ipv4 first, rslt is in network byte order */
|
||||||
@ -233,7 +229,6 @@ int ares_set_servers_csv(ares_channel channel,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* Set up for next one */
|
/* Set up for next one */
|
||||||
found_port = false;
|
|
||||||
start_host = ptr + 1;
|
start_host = ptr + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user