1
0
mirror of https://github.com/GOSTSec/sgminer synced 2025-01-11 07:17:58 +00:00

There is no need for addrinfo any more.

This commit is contained in:
Con Kolivas 2012-10-30 19:22:02 +11:00
parent a2d5783509
commit c2861d683a

13
util.c
View File

@ -836,7 +836,6 @@ bool extract_sockaddr(struct pool *pool, char *url)
{
char *url_begin, *url_end, *port_start = NULL;
char url_address[256], port[6];
struct addrinfo hints, *res;
int url_len, port_len = 0;
pool->sockaddr_url = url;
@ -866,18 +865,6 @@ bool extract_sockaddr(struct pool *pool, char *url)
strcpy(port, "80");
pool->stratum_port = strdup(port);
memset(&hints, 0, sizeof(struct addrinfo));
hints.ai_family = AF_UNSPEC;
hints.ai_socktype = SOCK_STREAM;
hints.ai_protocol = IPPROTO_TCP;
if (getaddrinfo(url_address, port, &hints, &res)) {
applog(LOG_DEBUG, "Failed to extract sock addr");
return false;
}
freeaddrinfo(res);
pool->sockaddr_url = strdup(url_address);
return true;