add banner
This commit is contained in:
parent
f42da49a80
commit
26bda82b25
|
@ -1,7 +1,16 @@
|
|||
#include <drogon/HttpAppFramework.h>
|
||||
#include <iostream>
|
||||
static const char banner[]=" _ \n"
|
||||
" __| |_ __ ___ __ _ ___ _ __ \n"
|
||||
" / _` | '__/ _ \\ / _` |/ _ \\| '_ \\ \n"
|
||||
"| (_| | | | (_) | (_| | (_) | | | |\n"
|
||||
" \\__,_|_| \\___/ \\__, |\\___/|_| |_|\n"
|
||||
" |___/ \n";
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout<<banner<<std::endl;
|
||||
drogon::HttpAppFramework framework("0.0.0.0",12345);
|
||||
trantor::Logger::setLogLevel(trantor::Logger::TRACE);
|
||||
framework.run();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ public:
|
|||
CallbackBucket tmp;
|
||||
{
|
||||
std::lock_guard<std::mutex> 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);
|
||||
|
||||
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue