{
if (empty())
v_requestEvent();
- Packet p;
if (! empty()) {
- p = peek();
+ Packet p ( queue_.back());
queue_.pop_back();
v_dequeueEvent();
+ SENF_PPI_TRACE(p, "IN ");
+ return p;
+ } else {
+ SENF_PPI_TRACE(Packet(), "IN ");
+ return Packet();
}
- SENF_PPI_TRACE(p, "IN ");
- return p;
}
////////////////////////////////////////
//
// * The PacketImpl destructor will *explicitly* clean-up the interpreters_ list by removing
// each element from the list and deleting it if it's (intrusive) refcount is 0
-// * The PacketInterpreters use safe hooks -> they know wether they are part of a list or not
+// * The PacketInterpreters use safe hooks -> they know whether they are part of a list or not
// * PacketHandle has an intrusive_ptr to PacketInterpreterBase. The intrusive_ptr_add_ref
// will refcount both the PacketImpl as well as the PacketInterpreterBase
// * intrusive_ptr_remove will only delete the object if it's not in a container
// * removing an object from the list will decrement the PacketImpl refcount accordingly
-// * inserting an object into the list will incroment the PacketImpl refcount accordingly
+// * inserting an object into the list will increment the PacketImpl refcount accordingly
// * each PacketInterpreterBase instance holds a *raw* pointer to the PacketImpl
//
// The following operations change refcounts:
: refcount_(0), data_(size,initValue), annotations_(AnnotationIndexerBase::maxAnnotations)
{}
-// rerference/memory management
+// reference/memory management
prefix_ void senf::detail::PacketImpl::add_ref(refcount_t n)
{
SENF_ASSERT(refcount_ >= n, "Internal failure: Releasing dead PacketImpl ??");
// uah ... we need to be extremely careful here. If refcount_ is n, we want to commit suicide,
// however the destructor will remove all PacketInterpreters from the list and will thereby
- // decrement refcount -> only decrenebt refcount_ when *not* caling delete
+ // decrement refcount -> only decrement refcount_ when *not* calling delete
if (refcount_ == n)
delete this;
else
BOOST_CHECK_EQUAL( addr3, INet6Address::from_string("1200::21") );
BOOST_CHECK_EQUAL( INet6Address::from_inet4address(INet4Address(0x01020304)),
INet6Address::from_string("::ffff:1.2.3.4") );
+ BOOST_CHECK( INet6Address::from_inet4address(INet4Address(0x01020304)).inet4Mapped());
BOOST_CHECK_THROW( INet6Address::from_string("1.2.3.4"), UnknownHostnameException );
BOOST_CHECK_EQUAL( INet6Address::from_string("1.2.3.4", INet6Address::ResolveINet4),
{
return eui64.isMACCompatible()
&& std::equal(eui64.begin(), eui64.begin()+3, mac.begin())
- && std::equal(eui64.begin()+5, eui64.begin()+8, mac.begin()+3);
+ && std::equal(eui64.begin()+5, eui64.end(), mac.begin()+3);
}
prefix_ bool senf::operator==(EUI64 const & eui64, MACAddress const & mac)