From c91f02365832acf9ae6d4a4aaad3ed1f89c17714 Mon Sep 17 00:00:00 2001 From: brain Date: Fri, 24 Feb 2006 00:20:49 +0000 Subject: Wrong address being bound by InspSocket when binding to a specific ip git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3315 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/socket.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/socket.cpp b/src/socket.cpp index 282d3c5a7..1af2b51ff 100644 --- a/src/socket.cpp +++ b/src/socket.cpp @@ -59,9 +59,10 @@ InspSocket::InspSocket(int newfd, char* ip) socket_ref[this->fd] = this; } -InspSocket::InspSocket(std::string host, int port, bool listening, unsigned long maxtime) +InspSocket::InspSocket(std::string ahost, int port, bool listening, unsigned long maxtime) { this->fd = -1; + this->host = ahost; if (listening) { if ((this->fd = OpenTCPSocket()) == ERROR) { @@ -73,7 +74,7 @@ InspSocket::InspSocket(std::string host, int port, bool listening, unsigned long } else { - if (BindSocket(this->fd,this->client,this->server,port,(char*)host.c_str()) == ERROR) + if (BindSocket(this->fd,this->client,this->server,port,(char*)ahost.c_str()) == ERROR) { this->Close(); this->fd = -1; -- cgit v1.2.3