From 2340d03cdf75e85bd2f76c92a1995474af488325 Mon Sep 17 00:00:00 2001 From: brain Date: Sun, 18 Apr 2004 11:43:42 +0000 Subject: Attempted dns fixes git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@641 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/connection.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/connection.cpp') diff --git a/src/connection.cpp b/src/connection.cpp index 28f3ef675..c4f0a3f72 100644 --- a/src/connection.cpp +++ b/src/connection.cpp @@ -119,24 +119,25 @@ void ircd_connector::SetServerPort(int p) bool ircd_connector::MakeOutboundConnection(char* host, int port) { + log(DEBUG,"MakeOutboundConnection: Original param: %s",host); hostent* hoste = gethostbyname(host); if (!hoste) { - WriteOpers("Failed to look up hostname for %s, using as an ip address",host); + log(DEBUG,"MakeOutboundConnection: gethostbyname was NULL, setting %s",host); this->SetHostAddress(host,port); SetHostAndPort(host,port); } else { - WriteOpers("Found hostname for %s",host); - this->SetHostAddress(hoste->h_addr,port); - SetHostAndPort(hoste->h_addr,port); + log(DEBUG,"MakeOutboundConnection: gethostbyname was valid, setting %s",(char *)hoste->h_addr); + this->SetHostAddress((char *)hoste->h_addr,port); + SetHostAndPort((char *)hoste->h_addr,port); } this->fd = socket(AF_INET, SOCK_STREAM, IPPROTO_TCP); if (this->fd >= 0) { - if(connect(this->fd, (sockaddr*)&addr,sizeof(addr))) + if(connect(this->fd, (sockaddr*)&this->addr,sizeof(this->addr))) { WriteOpers("connect() failed for %s",host); return false; -- cgit v1.3.1-10-gc9f91