diff --git a/Net/include/Poco/Net/IPAddress.h b/Net/include/Poco/Net/IPAddress.h index e96ba976c..f3737d448 100644 --- a/Net/include/Poco/Net/IPAddress.h +++ b/Net/include/Poco/Net/IPAddress.h @@ -397,67 +397,12 @@ private: // inlines // - -inline void IPAddress::destruct() -{ - pImpl()->~IPAddressImpl(); -} - - inline IPAddress::Ptr IPAddress::pImpl() const { return reinterpret_cast(const_cast(_memory.buffer)); } -inline void IPAddress::newIPv4() -{ - new (storage()) Poco::Net::Impl::IPv4AddressImpl; -} - - -inline void IPAddress::newIPv4(const void* hostAddr) -{ - new (storage()) Poco::Net::Impl::IPv4AddressImpl(hostAddr); -} - - -inline void IPAddress::newIPv4(unsigned prefix) -{ - new (storage()) Poco::Net::Impl::IPv4AddressImpl(prefix); -} - - -#if defined(POCO_HAVE_IPv6) - - -inline void IPAddress::newIPv6() -{ - new (storage()) Poco::Net::Impl::IPv6AddressImpl; -} - - -inline void IPAddress::newIPv6(const void* hostAddr) -{ - new (storage()) Poco::Net::Impl::IPv6AddressImpl(hostAddr); -} - - -inline void IPAddress::newIPv6(const void* hostAddr, Poco::UInt32 scope) -{ - new (storage()) Poco::Net::Impl::IPv6AddressImpl(hostAddr, scope); -} - - -inline void IPAddress::newIPv6(unsigned prefix) -{ - new (storage()) Poco::Net::Impl::IPv6AddressImpl(prefix); -} - - -#endif // POCO_HAVE_IPv6 - - inline char* IPAddress::storage() { return _memory.buffer; diff --git a/Net/src/ICMPSocketImpl.cpp b/Net/src/ICMPSocketImpl.cpp index 553816b96..c9ce146df 100644 --- a/Net/src/ICMPSocketImpl.cpp +++ b/Net/src/ICMPSocketImpl.cpp @@ -89,10 +89,10 @@ int ICMPSocketImpl::receiveFrom(void*, int, SocketAddress& address, int flags) } while (expected && !_icmpPacket.validReplyID(buffer.begin(), maxPacketSize)); } - catch (ICMPException&) - { - throw; - } + catch (ICMPException&) + { + throw; + } catch (Exception&) { std::string err = _icmpPacket.errorDescription(buffer.begin(), maxPacketSize); diff --git a/Net/src/IPAddress.cpp b/Net/src/IPAddress.cpp index d47397fd2..5f06611fd 100644 --- a/Net/src/IPAddress.cpp +++ b/Net/src/IPAddress.cpp @@ -219,6 +219,60 @@ IPAddress::~IPAddress() } +void IPAddress::destruct() +{ + pImpl()->~IPAddressImpl(); +} + + +void IPAddress::newIPv4() +{ + new (storage()) Poco::Net::Impl::IPv4AddressImpl; +} + + +void IPAddress::newIPv4(const void* hostAddr) +{ + new (storage()) Poco::Net::Impl::IPv4AddressImpl(hostAddr); +} + + +void IPAddress::newIPv4(unsigned prefix) +{ + new (storage()) Poco::Net::Impl::IPv4AddressImpl(prefix); +} + + +#if defined(POCO_HAVE_IPv6) + + +void IPAddress::newIPv6() +{ + new (storage()) Poco::Net::Impl::IPv6AddressImpl; +} + + +void IPAddress::newIPv6(const void* hostAddr) +{ + new (storage()) Poco::Net::Impl::IPv6AddressImpl(hostAddr); +} + + +void IPAddress::newIPv6(const void* hostAddr, Poco::UInt32 scope) +{ + new (storage()) Poco::Net::Impl::IPv6AddressImpl(hostAddr, scope); +} + + +void IPAddress::newIPv6(unsigned prefix) +{ + new (storage()) Poco::Net::Impl::IPv6AddressImpl(prefix); +} + + +#endif // POCO_HAVE_IPv6 + + IPAddress& IPAddress::operator = (const IPAddress& addr) { if (&addr != this) @@ -598,3 +652,4 @@ std::ostream& operator << (std::ostream& ostr, const Poco::Net::IPAddress& addr) ostr << addr.toString(); return ostr; } +