diff options
author | Mauro Sardara <msardara+fdio@cisco.com> | 2017-06-05 16:48:29 +0200 |
---|---|---|
committer | Mauro Sardara <msardara+fdio@cisco.com> | 2017-06-05 17:45:15 +0200 |
commit | d22d2b4785e2f4eafc8dda2ae032931f89c7e45f (patch) | |
tree | 47fa6879217c4b08e8a78efc33b8cd007a110866 /icnet/transport/icnet_transport_vegas.cc | |
parent | 52ab9bf241528b0cb1d24384d22b017391be2899 (diff) |
- Added new interface between applications and library:
- Application retrieve resources using the common HTTP url format.
- Translation between network names and application names performed by the library
- Added basic error handling
- Added utils for http connections
- Added support for differetn build types (DEBUG, RELEASE, RELEASE with debug symbols, RELEASE with min size executable)
- Added support for iOS
Change-Id: I8ba2a5d8bd70a4f7721e1bbc2efe3fb81ed2c98c
Signed-off-by: Mauro Sardara <msardara+fdio@cisco.com>
Diffstat (limited to 'icnet/transport/icnet_transport_vegas.cc')
-rw-r--r-- | icnet/transport/icnet_transport_vegas.cc | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/icnet/transport/icnet_transport_vegas.cc b/icnet/transport/icnet_transport_vegas.cc index d5a3c500..dd5c7c90 100644 --- a/icnet/transport/icnet_transport_vegas.cc +++ b/icnet/transport/icnet_transport_vegas.cc @@ -14,10 +14,12 @@ */ #include "icnet_transport_vegas.h" -#include "icnet_socket_consumer.h" +#include "icnet_transport_socket_consumer.h" namespace icnet { +namespace transport { + VegasTransportProtocol::VegasTransportProtocol(Socket *icnet_socket) : TransportProtocol(icnet_socket), is_final_block_number_discovered_(false), @@ -139,9 +141,9 @@ void VegasTransportProtocol::onContentSegment(const Interest &interest, ContentO on_interest_satisfied(*dynamic_cast<ConsumerSocket *>(socket_), const_cast<Interest &>(interest)); } - if (content_object.getContentType() == PayloadType::MANIFEST) { + if (content_object.getPayloadType() == PayloadType::MANIFEST) { onManifest(interest, content_object); - } else if (content_object.getContentType() == PayloadType::DATA) { + } else if (content_object.getPayloadType() == PayloadType::DATA) { onContentObject(interest, content_object); } // TODO InterestReturn @@ -381,8 +383,7 @@ void VegasTransportProtocol::copyContent(ContentObject &content_object) { socket_->getSocketOption(CONTENT_RETRIEVED, on_payload); if (on_payload != VOID_HANDLER) { on_payload(*dynamic_cast<ConsumerSocket *>(socket_), - (uint8_t *) (content_buffer_.data()), - content_buffer_.size()); + std::move(content_buffer_)); } //reduce window size to prevent its speculative growth in case when consume() is called in loop @@ -401,7 +402,7 @@ void VegasTransportProtocol::reassemble() { uint64_t index = last_reassembled_segment_ % default_values::default_buffer_size; while (receive_buffer_[index % default_values::default_buffer_size]) { - if (receive_buffer_[index % default_values::default_buffer_size]->getContentType() == PayloadType::DATA) { + if (receive_buffer_[index % default_values::default_buffer_size]->getPayloadType() == PayloadType::DATA) { copyContent(*receive_buffer_[index % default_values::default_buffer_size]); } @@ -484,4 +485,6 @@ void VegasTransportProtocol::removeAllPendingInterests() { portal_->clear(); } -} // namespace icn-interface +} // end namespace transport + +} // end namespace icnet |