diff options
author | Mauro Sardara <msardara+fdio@cisco.com> | 2017-06-05 18:43:52 +0200 |
---|---|---|
committer | Mauro Sardara <msardara+fdio@cisco.com> | 2017-06-05 20:32:17 +0200 |
commit | 4da1b7955fb3190c0e0646cfde99436aa140d271 (patch) | |
tree | bb9518b7aaf0c0493de03da83753d6a50f0aa9bf /http-server/icn_response.cc | |
parent | e8a980e1bc33adacb763066dc263f447656cb351 (diff) |
- Added proxy function
- Changed interface between library and application
- Support for different build type
Change-Id: I34ae75057490eb887d353e53c6d013f88bead04f
Signed-off-by: Mauro Sardara <msardara+fdio@cisco.com>
Diffstat (limited to 'http-server/icn_response.cc')
-rw-r--r-- | http-server/icn_response.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/http-server/icn_response.cc b/http-server/icn_response.cc index 6fe8b1e1..241eda51 100644 --- a/http-server/icn_response.cc +++ b/http-server/icn_response.cc @@ -17,22 +17,23 @@ namespace icn_httpserver { -IcnResponse::IcnResponse(std::shared_ptr<icnet::ProducerSocket> producer, +IcnResponse::IcnResponse(std::shared_ptr<libl4::http::HTTPServerPublisher> publisher, std::string ndn_name, std::string ndn_path, int response_id) - : producer_(producer), ndn_name_(ndn_name), ndn_path_(ndn_path), response_id_(response_id) { + : publisher_(publisher), ndn_name_(ndn_name), ndn_path_(ndn_path), response_id_(response_id) { } void IcnResponse::send(const SendCallback &callback) { std::size_t buffer_size = this->streambuf_.size(); this->streambuf_.commit(this->streambuf_.size()); - this->producer_->produce(icnet::Name(/*this->ndn_name*/), - boost::asio::buffer_cast<const uint8_t *>(this->streambuf_.data()), - buffer_size, - this->response_id_, - this->is_last_); + std::cout << "Rrsponse Id " << response_id_ << std::endl; + + this->publisher_->publishContent(boost::asio::buffer_cast<const uint8_t *>(this->streambuf_.data()), + buffer_size, + this->response_id_, + this->is_last_); this->streambuf_.consume(buffer_size); |