diff --git a/examples/static_link_example/main.cc b/examples/static_link_example/main.cc index b31a2896..45e44c70 100755 --- a/examples/static_link_example/main.cc +++ b/examples/static_link_example/main.cc @@ -1,7 +1,16 @@ #include +#include +static const char banner[]=" _ \n" + " __| |_ __ ___ __ _ ___ _ __ \n" + " / _` | '__/ _ \\ / _` |/ _ \\| '_ \\ \n" + "| (_| | | | (_) | (_| | (_) | | | |\n" + " \\__,_|_| \\___/ \\__, |\\___/|_| |_|\n" + " |___/ \n"; + int main() { + std::cout< lock(bucketMutex_); - //use tmp to make this critical area as short as possible. + //use tmp val to make this critical area as short as possible. event_bucket_queue_.front().swap(tmp); event_bucket_queue_.pop_front(); event_bucket_queue_.push_back(CallbackBucket()); @@ -89,7 +89,7 @@ public: { timeout=map_[key].timeout; } - if(timeout) + if(timeout>0) eraseAfter(timeout,key); @@ -105,7 +105,7 @@ public: timeout=map_[key].timeout; flag=true; } - if(timeout) + if(timeout>0) eraseAfter(timeout,key); diff --git a/lib/inc/drogon/HttpResponse.h b/lib/inc/drogon/HttpResponse.h index d3e85ed6..fa807fdd 100755 --- a/lib/inc/drogon/HttpResponse.h +++ b/lib/inc/drogon/HttpResponse.h @@ -188,6 +188,10 @@ public: { body_ = body; } + void setBody(std::string&& body) + { + body_ = std::move(body); + } void redirect(const std::string& url) { headers_["Location"] = url;