mirror of
https://github.com/resiprocate/resiprocate.git
synced 2026-01-12 00:05:02 +08:00
implement more Message ops
git-svn-id: https://svn.resiprocate.org/rep/resiprocate/main@8072 ddefafc4-47db-0310-ae44-fa13212b10f2
This commit is contained in:
@@ -89,6 +89,13 @@ DestinationId::operator==(const DestinationId& nid) const
|
||||
return false;
|
||||
}
|
||||
|
||||
s2c::DestinationStruct*
|
||||
DestinationId::copyDestinationStruct() const
|
||||
{
|
||||
return new s2c::DestinationStruct(*this);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* ======================================================================
|
||||
|
||||
@@ -27,6 +27,8 @@ class DestinationId : private s2c::DestinationStruct
|
||||
|
||||
bool operator==(const NodeId& nid) const;
|
||||
bool operator==(const DestinationId& nid) const;
|
||||
|
||||
s2c::DestinationStruct* copyDestinationStruct() const;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -252,11 +252,19 @@ Message::parse(const resip::Data &message)
|
||||
void
|
||||
Message::copyForwardingData(const Message &header)
|
||||
{
|
||||
mPDU.mHeader->mOverlay = header.mPDU.mHeader->mOverlay;
|
||||
mPDU.mHeader->mTransactionId = header.mPDU.mHeader->mTransactionId;
|
||||
assert(header.isRequest());
|
||||
mPDU.mHeader->mOverlay = header.mPDU.mHeader->mOverlay;
|
||||
mPDU.mHeader->mTransactionId = header.mPDU.mHeader->mTransactionId;
|
||||
|
||||
assert(mPDU.mHeader->mDestinationList.empty());
|
||||
std::vector<DestinationStruct*>::reverse_iterator i;
|
||||
for (i=header.mPDU.mHeader->mViaList.rbegin(); i!=header.mPDU.mHeader->mViaList.rend(); ++i)
|
||||
{
|
||||
DestinationStruct* ds = new DestinationStruct(**i);
|
||||
mPDU.mHeader->mDestinationList.push_back(ds);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Message::decrementTTL()
|
||||
{
|
||||
@@ -442,11 +450,19 @@ Message::event()
|
||||
}
|
||||
|
||||
void
|
||||
Message::pushVia(NodeId id)
|
||||
Message::pushVia(const DestinationId& did)
|
||||
{
|
||||
assert(0);
|
||||
assert(!did.isResourceId());
|
||||
mPDU.mHeader->mViaList.push_back(did.copyDestinationStruct());
|
||||
}
|
||||
|
||||
void
|
||||
Message::pushDestinationId(const DestinationId& did)
|
||||
{
|
||||
mPDU.mHeader->mDestinationList.push_back(did.copyDestinationStruct());
|
||||
}
|
||||
|
||||
|
||||
/* ======================================================================
|
||||
* Copyright (c) 2008, Various contributors to the Resiprocate project
|
||||
* All rights reserved.
|
||||
|
||||
@@ -107,7 +107,8 @@ class Message : public Signable
|
||||
UInt32 getOverlay() const;
|
||||
UInt64 getTransactionId() const;
|
||||
UInt16 getFlags() const;
|
||||
void pushVia(NodeId node);
|
||||
void pushVia(const DestinationId& node);
|
||||
void pushDestinationId(const DestinationId& did);
|
||||
|
||||
NodeId getResponseNodeId() const; // pull this from the via list
|
||||
|
||||
|
||||
Reference in New Issue
Block a user