From 3bce9bfdce707313de4f9cccdc867abd9edf82df Mon Sep 17 00:00:00 2001 From: Mauro Sardara Date: Fri, 7 Feb 2020 20:00:06 +0100 Subject: [HICN-508] [HICN-509] [HICN-506] Manifest rework Change-Id: I992205148910be008d66b5acb7f6f1365770f9e8 Signed-off-by: Mauro Sardara --- apps/http-proxy/src/ATSConnector.h | 2 +- apps/http-proxy/src/IcnReceiver.cc | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) (limited to 'apps') diff --git a/apps/http-proxy/src/ATSConnector.h b/apps/http-proxy/src/ATSConnector.h index aa5662e24..db485605f 100644 --- a/apps/http-proxy/src/ATSConnector.h +++ b/apps/http-proxy/src/ATSConnector.h @@ -36,7 +36,7 @@ typedef std::deque< BufferQueue; class ATSConnector { - static constexpr uint32_t buffer_size = 1024 * 64; + static constexpr uint32_t buffer_size = 1024 * 512; enum class ConnectorState { CLOSED, diff --git a/apps/http-proxy/src/IcnReceiver.cc b/apps/http-proxy/src/IcnReceiver.cc index 18553d84b..8d0fb4917 100644 --- a/apps/http-proxy/src/IcnReceiver.cc +++ b/apps/http-proxy/src/IcnReceiver.cc @@ -79,6 +79,13 @@ AsyncConsumerProducer::AsyncConsumerProducer( TRANSPORT_LOGD("Warning: output buffer size has not been set."); } + ret = producer_socket_.setSocketOption( + interface::GeneralTransportOptions::MAKE_MANIFEST, true); + + if (ret != SOCKET_OPTION_SET) { + TRANSPORT_LOGD("Warning: impossible to enable signatures."); + } + ret = producer_socket_.setSocketOption( interface::GeneralTransportOptions::DATA_PACKET_SIZE, mtu_); @@ -130,6 +137,8 @@ void AsyncConsumerProducer::manageIncomingInterest( auto _it = chunk_number_map_.find(name); auto _end = chunk_number_map_.end(); + std::cout << "Received interest " << seg << std::endl; + if (_it != _end) { if (_it->second.second) { // Content is in production @@ -137,7 +146,7 @@ void AsyncConsumerProducer::manageIncomingInterest( } if (seg >= _it->second.first) { - TRANSPORT_LOGD( + TRANSPORT_LOGI( "Ignoring interest with name %s for a content object which does not " "exist. (Request: %u, max: %u)", name.toString().c_str(), (uint32_t)seg, (uint32_t)_it->second.first); @@ -145,6 +154,8 @@ void AsyncConsumerProducer::manageIncomingInterest( } } + std::cout << "Received interest " << seg << std::endl; + bool is_mpd = HTTPMessageFastParser::isMpdRequest(payload->data(), payload->length()); @@ -194,6 +205,7 @@ void AsyncConsumerProducer::publishContent(const uint8_t* data, if (headers) { request_counter_++; } + it->second.first += producer_socket_.produce(name, data, size, is_last, start_suffix); -- cgit 1.2.3-korg