Merge pull request #30 from an-tao/dev

Minor edits
This commit is contained in:
An Tao 2019-01-18 10:41:00 +08:00 committed by GitHub
commit 68a7a6b5e4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 28 additions and 15 deletions

View File

@ -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

View File

@ -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}

View 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;

View File

@ -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

@ -1 +1 @@
Subproject commit c0e226fdd4cd1bab383d2f3601786d6eaf5474d8
Subproject commit f18818dea97d2ee8e7f60a10d2f289b9cecbd6e6