mirror of
https://gitee.com/an-tao/drogon.git
synced 2024-12-02 11:47:56 +08:00
Modify HttpAppFrameworkImpl
This commit is contained in:
parent
87b6d571fd
commit
1afb027f2f
@ -521,7 +521,7 @@ void HttpAppFrameworkImpl::doFilterChain(const std::shared_ptr<std::queue<std::s
|
||||
const std::string &session_id,
|
||||
const std::function<void()> &missCallback)
|
||||
{
|
||||
if (chain->size() > 0)
|
||||
if (chain && chain->size() > 0)
|
||||
{
|
||||
auto filter = chain->front();
|
||||
chain->pop();
|
||||
@ -542,10 +542,11 @@ void HttpAppFrameworkImpl::doFilters(const std::vector<std::string> &filters,
|
||||
const std::string &session_id,
|
||||
const std::function<void()> &missCallback)
|
||||
{
|
||||
LOG_TRACE << "filters count:" << filters.size();
|
||||
std::shared_ptr<std::queue<std::shared_ptr<HttpFilterBase>>> filterPtrs =
|
||||
std::make_shared<std::queue<std::shared_ptr<HttpFilterBase>>>();
|
||||
for (auto filter : filters)
|
||||
std::shared_ptr<std::queue<std::shared_ptr<HttpFilterBase>>> filterPtrs;
|
||||
if (!filters.empty())
|
||||
{
|
||||
filterPtrs = std::make_shared<std::queue<std::shared_ptr<HttpFilterBase>>>();
|
||||
for (auto &filter : filters)
|
||||
{
|
||||
auto _object = std::shared_ptr<DrObjectBase>(DrClassMap::newObject(filter));
|
||||
auto _filter = std::dynamic_pointer_cast<HttpFilterBase>(_object);
|
||||
@ -556,6 +557,7 @@ void HttpAppFrameworkImpl::doFilters(const std::vector<std::string> &filters,
|
||||
LOG_ERROR << "filter " << filter << " not found";
|
||||
}
|
||||
}
|
||||
}
|
||||
doFilterChain(filterPtrs, req, callback, needSetJsessionid, session_id, missCallback);
|
||||
}
|
||||
void HttpAppFrameworkImpl::onWebsockDisconnect(const WebSocketConnectionPtr &wsConnPtr)
|
||||
|
Loading…
Reference in New Issue
Block a user