diff options
Diffstat (limited to 'icnet/http/icnet_http_server_publisher.cc')
-rw-r--r-- | icnet/http/icnet_http_server_publisher.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/icnet/http/icnet_http_server_publisher.cc b/icnet/http/icnet_http_server_publisher.cc index 92b41e6c..e42154b2 100644 --- a/icnet/http/icnet_http_server_publisher.cc +++ b/icnet/http/icnet_http_server_publisher.cc @@ -63,13 +63,15 @@ HTTPServerPublisher &HTTPServerPublisher::setTimeout(uint32_t timeout) { return *this; } -void HTTPServerPublisher::publishContent(const uint8_t *buf, size_t buffer_size, const int response_id, bool is_last) { +void HTTPServerPublisher::publishContent(const uint8_t *buf, size_t buffer_size, std::chrono::milliseconds content_lifetime, const int response_id, bool is_last) { if (producer_) { #ifdef __ANDROID__ __android_log_print(ANDROID_LOG_DEBUG, "HTTP_SERVER_PUBLISHER", "Replying to %s", const_cast<transport::Name &>(content_name_).toString().c_str()); #else std::cout << "Replying to " << content_name_ << std::endl; #endif + producer_->setSocketOption(transport::GeneralTransportOptions::CONTENT_OBJECT_EXPIRY_TIME, static_cast<int>(content_lifetime.count())); + producer_->produce(content_name_, buf, buffer_size, response_id, is_last); } } |