diff options
Diffstat (limited to 'src/network/core/address.cpp')
-rw-r--r-- | src/network/core/address.cpp | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/src/network/core/address.cpp b/src/network/core/address.cpp index a29640056..888625dc1 100644 --- a/src/network/core/address.cpp +++ b/src/network/core/address.cpp @@ -21,17 +21,6 @@ const char *NetworkAddress::GetHostname() return this->hostname; } -uint32 NetworkAddress::GetIP() -{ - assert(this->address.ss_family == AF_INET); - - if (!this->resolved) { - ((struct sockaddr_in *)&this->address)->sin_addr.s_addr = NetworkResolveHost(this->hostname); - this->resolved = true; - } - return ((struct sockaddr_in *)&this->address)->sin_addr.s_addr; -} - uint16 NetworkAddress::GetPort() const { switch (this->address.ss_family) { @@ -66,7 +55,10 @@ const char *NetworkAddress::GetAddressAsString() const sockaddr_storage *NetworkAddress::GetAddress() { - if (!this->resolved) this->GetIP(); + if (!this->resolved) { + ((struct sockaddr_in *)&this->address)->sin_addr.s_addr = NetworkResolveHost(this->hostname); + this->resolved = true; + } return &this->address; } |