(svn r15914) -Codechange: let the content handling make use of NetworkAddress.
This commit is contained in:
@@ -7,7 +7,9 @@
|
||||
#ifdef ENABLE_NETWORK
|
||||
|
||||
#include "address.h"
|
||||
#include "config.h"
|
||||
#include "host.h"
|
||||
#include "../../string_func.h"
|
||||
|
||||
const char *NetworkAddress::GetHostname() const
|
||||
{
|
||||
@@ -27,4 +29,13 @@ uint32 NetworkAddress::GetIP()
|
||||
return this->ip;
|
||||
}
|
||||
|
||||
const char *NetworkAddress::GetAddressAsString() const
|
||||
{
|
||||
/* 6 = for the : and 5 for the decimal port number */
|
||||
static char buf[NETWORK_HOSTNAME_LENGTH + 6];
|
||||
|
||||
seprintf(buf, lastof(buf), "%s:%d", this->GetHostname(), this->GetPort());
|
||||
return buf;
|
||||
}
|
||||
|
||||
#endif /* ENABLE_NETWORK */
|
||||
|
Reference in New Issue
Block a user