Project

General

Profile

Actions

Bug #1774

closed

Packet size limit is not exposed or restricted in Face

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

Status:
Closed
Priority:
Normal
Category:
Base
Target version:
Start date:
07/18/2014
Due date:
% Done:

100%

Estimated time:

Description

Snippet to reproduce:

// g++ packetlength.cpp `pkg-config --libs --cflags libndn-cxx`

#include <ndn-cxx/face.hpp>
#include <ndn-cxx/security/key-chain.hpp>

using namespace ndn;

int
main(int argc, char** argv)
{
  Face face;
  KeyChain keyChain;

  static uint8_t buffer[9000];

  shared_ptr<Data> data = make_shared<Data>("/A");
  data->setContent(buffer, sizeof(buffer));
  keyChain.sign(*data);
  face.put(*data);

  face.processEvents();
}

Actual:

terminate called after throwing an instance of 'ndn::Transport::Error'
  what():  error while receiving data from socket (Connection reset by peer)
Aborted (core dumped)

Expected:

  • A constant equal to NFD's MAX_NDN_PACKET_SIZE is defined as part of ndn-cxx public API
  • An exception is raised in Face::put and Face::expressInterest when packet size exceeds the limit
Actions

Also available in: Atom PDF