From bf541442ea814c429d53f9e3985ecf219ecfc679 Mon Sep 17 00:00:00 2001 From: yhirose Date: Mon, 5 Aug 2019 10:51:27 +0900 Subject: [PATCH] Updated README --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 65887f8..3c48097 100644 --- a/README.md +++ b/README.md @@ -90,14 +90,15 @@ svr.Post("/multipart", [&](const auto& req, auto& res) { const uint64_t DATA_CHUNK_SIZE = 4; svr.Get("/stream", [&](const Request &req, Response &res) { - auto data = std::make_shared("abcdefg"); + auto data = new std::string("abcdefg"); res.set_content_provider( data->size(), // Content length [data](uint64_t offset, uint64_t length, Out out) { const auto &d = *data; out(&d[offset], std::min(length, DATA_CHUNK_SIZE)); - }); + }, + [data] { delete data; }); }); ```