Project

General

Profile

Actions

Bug #2720

open

Face::unsetInterestFilter is ineffective before registration completes

Added by Junxiao Shi over 9 years ago. Updated over 9 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
Base
Target version:
-
Start date:
04/01/2015
Due date:
% Done:

0%

Estimated time:

Description

Snippet to reproduce:

// g++ -std=c++0x x.cpp $(pkg-config --cflags --libs libndn-cxx)
#include <ndn-cxx/face.hpp>

using namespace ndn;

int
main()
{
  Face face;

  const RegisteredPrefixId* id = face.setInterestFilter("/A",
    [=] (const Name&, const Interest& interest) {
      std::cout << interest << std::endl;
    },
    [=] (const Name&) {
      std::cout << "DONE" << std::endl;
    },
    [=] (const Name&, const std::string&) {
      std::cout << "FAIL" << std::endl;
    });

  face.unsetInterestFilter(id);

  face.processEvents();

  return 0;
}
  1. call Face::setInterestFilter to register a prefix
  2. before the registration completes, call Face::unsetInterestFilter to undo the registration

Expected: after both operations, prefix registration does not exist

Actual: prefix registration still exists in both NFD and ndn::Face

Actions

Also available in: Atom PDF