Fix some little compilation errors with some configs, from last commit

This commit is contained in:
louiz’
2016-11-15 00:49:55 +01:00
parent d872c2b492
commit 4ab3cd653f
3 changed files with 3 additions and 7 deletions
@@ -161,14 +161,14 @@ void TCPClientSocketHandler::connect(const std::string& address, const std::stri
struct sockaddr_in6 a;
socklen_t l = sizeof(a);
if (::getsockname(this->socket, (struct sockaddr*)&a, &l) != -1)
this->local_port = ::ntohs(a.sin6_port);
this->local_port = ntohs(a.sin6_port);
}
else if (rp->ai_family == AF_INET)
{
struct sockaddr_in a;
socklen_t l = sizeof(a);
if (::getsockname(this->socket, (struct sockaddr*)&a, &l) != -1)
this->local_port = ::ntohs(a.sin_port);
this->local_port = ntohs(a.sin_port);
}
log_debug("Local port: ", this->local_port, ", and remote port: ", this->port);