🚚🐛 moved static declarations & fixed RESPONSE_PARSE

This commit is contained in:
EntireTwix 2021-07-24 17:25:20 -07:00
parent 1120b7b4d0
commit 0f28a0cc19

View file

@ -1,29 +1,5 @@
#include "bank_api.h"
#if MULTI_THREADED
phmap::parallel_flat_hash_map<
std::string, User,
xxHashStringGen,
phmap::priv::hash_default_eq<std::string>,
phmap::priv::Allocator<phmap::priv::Pair<const std::string, User>>,
4UL,
std::mutex>
Bank::users;
#else
phmap::parallel_flat_hash_map<std::string, User, xxHashStringGen> Bank::users;
#endif
#if CONSERVATIVE_DISK_SAVE
#if MULTI_THREADED
ChangeFlag<false> Bank::save_flag;
#else
bool Bank::save_flag = false;
#endif
#endif
std::shared_mutex Bank::iter_lock;
std::string Bank::admin_account;
#define CACHE_FOREVER resp->setExpiredTime(0)
#define CORS resp->addHeader("Access-Control-Allow-Origin", "*")
@ -34,7 +10,7 @@ static thread_local ondemand::parser parser;
auto doc = parser.iterate(input);
#define RESPONSE_PARSE(R) \
static thread_local auto resp = HttpResponse::newCustomHttpResponse(R); \
auto resp = HttpResponse::newCustomHttpResponse(R); \
CORS; \
callback(resp)