diff options
author | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-04-18 11:43:42 +0000 |
---|---|---|
committer | brain <brain@e03df62e-2008-0410-955e-edbf42e46eb7> | 2004-04-18 11:43:42 +0000 |
commit | 2340d03cdf75e85bd2f76c92a1995474af488325 (patch) | |
tree | 510b72abe61a860ee382a523082d5e8e4941628b /src/connection.cpp | |
parent | 37b7be5bfa32039200f760c03ec94dd995a25f2a (diff) |
Attempted dns fixes
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@641 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/connection.cpp')
-rw-r--r-- | src/connection.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
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; |