Skip to content

Commit 7ec90db

Browse files
committed
Clean up debug code in net.cc
1 parent 2b557c4 commit 7ec90db

File tree

1 file changed

+3
-20
lines changed

1 file changed

+3
-20
lines changed

src/net.cc

+3-20
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ Connection::Resolve (eio_req *req)
243243
{
244244
Connection *connection = static_cast<Connection*> (req->data);
245245
struct addrinfo *address = NULL;
246-
req->result = getaddrinfo(connection->host_, connection->port_, &client_tcp_hints, &address);
246+
req->result = getaddrinfo(connection->host_, connection->port_,
247+
&client_tcp_hints, &address);
247248
req->ptr2 = address;
248249

249250
free(connection->host_);
@@ -264,29 +265,11 @@ AddressDefaultToIPv4 (struct addrinfo *address_list)
264265
{
265266
struct addrinfo *address = NULL;
266267

267-
/*
268-
char ip4[INET_ADDRSTRLEN], ip6[INET6_ADDRSTRLEN];
269-
for (address = address_list; address != NULL; address = address->ai_next) {
270-
if (address->ai_family == AF_INET) {
271-
struct sockaddr_in *sa = reinterpret_cast<struct sockaddr_in*>(address->ai_addr);
272-
inet_ntop(AF_INET, &(sa->sin_addr), ip4, INET_ADDRSTRLEN);
273-
printf("%s\n", ip4);
274-
275-
} else if (address->ai_family == AF_INET6) {
276-
struct sockaddr_in6 *sa6 = reinterpret_cast<struct sockaddr_in6*>(address->ai_addr);
277-
inet_ntop(AF_INET6, &(sa6->sin6_addr), ip6, INET6_ADDRSTRLEN);
278-
printf("%s\n", ip6);
279-
}
280-
}
281-
*/
282-
283268
for (address = address_list; address != NULL; address = address->ai_next) {
284269
if (address->ai_addr->sa_family == AF_INET) break;
285270
}
286271

287-
if (address == NULL) address = address_list;
288-
289-
return address;
272+
return address == NULL ? address_list : address;
290273
}
291274

292275
int

0 commit comments

Comments
 (0)