- Set mpd lifetime to 1 second
- Change default lifetime for a generic content
Change-Id: I43fd9e61d5cba059e32f67665d0ac22ce04682de
Signed-off-by: Mauro Sardara <[email protected]>
configure_file("${PROJECT_SOURCE_DIR}/config.h.in"
"${CMAKE_BINARY_DIR}/config.h")
-include_directories(${LIB${TRANSPORT_LIBRARY}_INCLUDE_DIRS})
+include_directories(${LIB${TRANSPORT_LIBRARY}_INCLUDE_DIRS} http-server http-client)
find_package(Threads REQUIRED)
* limitations under the License.
*/
+#include "response.h"
#include "http_client.h"
#include <curl/curl.h>
#include <iostream>
using namespace std;
+using namespace icn_httpserver;
size_t write_data(void *ptr, size_t size, size_t nmemb, void *stream) {
- ((ostream*) stream)->write((const char*)ptr, size * nmemb);
+ ((Response*) stream)->write((const char*)ptr, size * nmemb);
+ ((Response*) stream)->send();
return size * nmemb;
}
}
return true;
-}
\ No newline at end of file
+}
#include "common.h"
#include "response.h"
-#define DEFAULT_LIFETIME 1024 * 1024
+#define DEFAULT_LIFETIME 1000 * 1000
namespace icn_httpserver {
path = boost::filesystem::canonical(path);
+ if (path.extension().string() == ".mpd") {
+ response->setResponseLifetime(std::chrono::milliseconds(1000));
+ }
+
//Check if path is within web_root_path
if (distance(web_root_path.begin(), web_root_path.end()) <= distance(path.begin(), path.end())
&& equal(web_root_path.begin(), web_root_path.end(), path.begin())) {