check validity of PDU
This commit is contained in:
parent
41d7553e1e
commit
7981acc57b
|
@ -123,6 +123,10 @@ void Receiver::onDiscovered(const EXTENDED::DISCOVERY::Watcher cb) {
|
|||
* Receive VECTOR_ROOT_E131_DATA vector'd packets.
|
||||
*/
|
||||
void Receiver::dataReceiver(std::shared_ptr<RLP::Pdu> root) {
|
||||
// check that PDU is valid
|
||||
if (root->stream()->fail())
|
||||
return;
|
||||
|
||||
auto block = PDU::Block<DATA::Pdu>();
|
||||
block.iStream(root->stream());
|
||||
if (root->stream()->fail())
|
||||
|
@ -153,6 +157,10 @@ void Receiver::dataReceiver(std::shared_ptr<RLP::Pdu> root) {
|
|||
* Receive VECTOR_ROOT_E131_EXTENDED vector'd packets.
|
||||
*/
|
||||
void Receiver::extendedReceiver(std::shared_ptr<RLP::Pdu> root) {
|
||||
// check that PDU is valid
|
||||
if (root->stream()->fail())
|
||||
return;
|
||||
|
||||
auto block = PDU::Block<EXTENDED::Pdu>();
|
||||
block.iStream(root->stream());
|
||||
if (root->stream()->fail())
|
||||
|
@ -188,6 +196,9 @@ void Receiver::extendedReceiver(std::shared_ptr<RLP::Pdu> root) {
|
|||
*
|
||||
*/
|
||||
void Receiver::dataFrameHandler(std::shared_ptr<DATA::Pdu> frame) {
|
||||
// check that PDU is valid
|
||||
if (frame->stream()->fail())
|
||||
return;
|
||||
|
||||
auto source = std::shared_ptr<UniverseSource>(new UniverseSource(frame));
|
||||
|
||||
|
@ -264,6 +275,10 @@ void Receiver::syncFrameHandler(std::shared_ptr<EXTENDED::Pdu> frame)
|
|||
* @param frame
|
||||
*/
|
||||
void Receiver::discoveryFrameHandler(std::shared_ptr<EXTENDED::Pdu> frame) {
|
||||
// check that PDU is valid
|
||||
if (frame->stream()->fail())
|
||||
return;
|
||||
|
||||
// PDU data will be a block of Discovery List PDU
|
||||
auto block = static_cast<PDU::Block<EXTENDED::DISCOVERY::Pdu>*>(frame->data());
|
||||
|
||||
|
@ -289,6 +304,9 @@ void Receiver::discoveryFrameHandler(std::shared_ptr<EXTENDED::Pdu> frame) {
|
|||
* @param pdu
|
||||
*/
|
||||
void Receiver::discoveryListHanlder(std::shared_ptr<EXTENDED::DISCOVERY::Pdu> pdu) {
|
||||
// check that PDU is valid
|
||||
if (pdu->stream()->fail())
|
||||
return;
|
||||
|
||||
auto data = static_cast<EXTENDED::DISCOVERY::discovery_list_data*>(pdu->data());
|
||||
for (auto& f : data->found)
|
||||
|
|
Loading…
Reference in New Issue