X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1539c2f54a43b0de6f6d75437b04d30872da9ea4..6962f34ea5bf7a931bb9b636f46ad1316473a724:/src/common/sckaddr.cpp diff --git a/src/common/sckaddr.cpp b/src/common/sckaddr.cpp index 8e638c3537..4fd8ce90ed 100644 --- a/src/common/sckaddr.cpp +++ b/src/common/sckaddr.cpp @@ -108,13 +108,18 @@ bool wxIPV4address::Hostname(const wxString& name) wxLogWarning( _("Trying to solve a NULL hostname: giving up") ); return FALSE; } - + m_origHostname = name; return (GAddress_INET_SetHostName(m_address, name.mb_str()) == GSOCK_NOERROR); } bool wxIPV4address::Hostname(unsigned long addr) { - return (GAddress_INET_SetHostAddress(m_address, addr) == GSOCK_NOERROR); + bool rv = (GAddress_INET_SetHostAddress(m_address, addr) == GSOCK_NOERROR); + if (rv) + m_origHostname = Hostname(); + else + m_origHostname = ""; + return rv; } bool wxIPV4address::Service(const wxString& name) @@ -151,6 +156,13 @@ unsigned short wxIPV4address::Service() return GAddress_INET_GetPort(m_address); } +wxSockAddress *wxIPV4address::Clone() const +{ + wxIPV4address *addr = new wxIPV4address(*this); + addr->m_origHostname = m_origHostname; + return addr; +} + #if 0 // --------------------------------------------------------------------------- // wxIPV6address