commit
68a7a6b5e4
|
@ -23,7 +23,7 @@ class ApiTest : public drogon::HttpController<ApiTest>
|
|||
void staticApi(const HttpRequestPtr &req, const std::function<void(const HttpResponsePtr &)> &callback);
|
||||
void get2(const HttpRequestPtr &req, const std::function<void(const HttpResponsePtr &)> &callback, std::string &&p1);
|
||||
void rootGet(const HttpRequestPtr &req, const std::function<void(const HttpResponsePtr &)> &callback);
|
||||
void rootPost(const HttpRequestPtr &req, const std::function<void(const HttpResponsePtr &)> &callback);
|
||||
void rootPost(const HttpRequestPtr &req, const std::function<void(const HttpResponsePtr &)> &callback);
|
||||
};
|
||||
} // namespace v1
|
||||
} // namespace api
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
GIT_VER=`git log|grep ^commit|wc -l|sed -e "s/^ *//"`
|
||||
MD5=`git log|head -1|awk '{printf $2}'`
|
||||
GIT_VER=$(git log|grep ^commit|wc -l|sed -e "s/^ *//")
|
||||
MD5=$(git log|head -1|awk '{printf $2}')
|
||||
TMP_FILE=/tmp/version
|
||||
echo "#define VERSION \"0.9.15.$GIT_VER\"" > ${TMP_FILE}
|
||||
echo "#define VERSION_MD5 \"$MD5\"" >> ${TMP_FILE}
|
||||
|
|
|
@ -128,8 +128,6 @@ class HttpAppFrameworkImpl : public HttpAppFramework
|
|||
const internal::HttpBinderBasePtr &binder,
|
||||
const std::vector<HttpMethod> &validMethods = std::vector<HttpMethod>(),
|
||||
const std::vector<std::string> &filters = std::vector<std::string>()) override;
|
||||
|
||||
std::vector<std::tuple<std::string, uint16_t, bool, std::string, std::string>> _listeners;
|
||||
void onAsyncRequest(const HttpRequestImplPtr &req, const std::function<void(const HttpResponsePtr &)> &callback);
|
||||
void onNewWebsockRequest(const HttpRequestImplPtr &req,
|
||||
const std::function<void(const HttpResponsePtr &)> &callback,
|
||||
|
@ -142,15 +140,6 @@ class HttpAppFrameworkImpl : public HttpAppFramework
|
|||
const internal::HttpBinderBasePtr &binder,
|
||||
const std::vector<HttpMethod> &validMethods,
|
||||
const std::vector<std::string> &filters);
|
||||
//if uuid package found,we can use a uuid string as session id;
|
||||
//set _sessionTimeout=0 to make location session valid forever based on cookies;
|
||||
size_t _sessionTimeout = 0;
|
||||
size_t _idleConnectionTimeout = 60;
|
||||
bool _useSession = false;
|
||||
typedef std::shared_ptr<Session> SessionPtr;
|
||||
std::unique_ptr<CacheMap<std::string, SessionPtr>> _sessionMapPtr;
|
||||
std::unique_ptr<CacheMap<std::string, HttpResponsePtr>> _responseCachingMap;
|
||||
|
||||
void doFilterChain(const std::shared_ptr<std::queue<std::shared_ptr<HttpFilterBase>>> &chain,
|
||||
const HttpRequestImplPtr &req,
|
||||
const std::function<void(const HttpResponsePtr &)> &callback,
|
||||
|
@ -158,6 +147,16 @@ class HttpAppFrameworkImpl : public HttpAppFramework
|
|||
const std::string &session_id,
|
||||
const std::function<void()> &missCallback);
|
||||
|
||||
//We use a uuid string as session id;
|
||||
//set _sessionTimeout=0 to make location session valid forever based on cookies;
|
||||
size_t _sessionTimeout = 0;
|
||||
size_t _idleConnectionTimeout = 60;
|
||||
bool _useSession = false;
|
||||
std::vector<std::tuple<std::string, uint16_t, bool, std::string, std::string>> _listeners;
|
||||
typedef std::shared_ptr<Session> SessionPtr;
|
||||
std::unique_ptr<CacheMap<std::string, SessionPtr>> _sessionMapPtr;
|
||||
std::unique_ptr<CacheMap<std::string, HttpResponsePtr>> _responseCachingMap;
|
||||
|
||||
HttpSimpleControllersRouter _httpSimpleCtrlsRouter;
|
||||
HttpControllersRouter _httpCtrlsRouter;
|
||||
WebsocketControllersRouter _websockCtrlsRouter;
|
||||
|
|
|
@ -1,3 +1,17 @@
|
|||
/**
|
||||
*
|
||||
* WebsocketControllersRouter.cc
|
||||
* An Tao
|
||||
*
|
||||
* Copyright 2018, An Tao. All rights reserved.
|
||||
* https://github.com/an-tao/drogon
|
||||
* Use of this source code is governed by a MIT license
|
||||
* that can be found in the License file.
|
||||
*
|
||||
* Drogon
|
||||
*
|
||||
*/
|
||||
|
||||
#include "WebsocketControllersRouter.h"
|
||||
#include "HttpAppFrameworkImpl.h"
|
||||
#ifdef USE_OPENSSL
|
||||
|
|
2
trantor
2
trantor
|
@ -1 +1 @@
|
|||
Subproject commit c0e226fdd4cd1bab383d2f3601786d6eaf5474d8
|
||||
Subproject commit f18818dea97d2ee8e7f60a10d2f289b9cecbd6e6
|
Loading…
Reference in New Issue