Compare commits

..

No commits in common. "3fa480dd87eab39de0cb292687ee4f36611906c6" and "9b2716ec24a32ca7a34bc30b94e326fc5769f4cc" have entirely different histories.

6 changed files with 57 additions and 58 deletions

View File

@ -175,6 +175,7 @@ jobs:
if: runner.os == 'macOS'
run: |
cd $(brew --prefix)/Homebrew/Library/Taps/homebrew/homebrew-services
git reset --hard 5f2fe01
cd ~
brew tap homebrew/services
brew services restart postgresql

1
_config.yml Normal file
View File

@ -0,0 +1 @@
theme: jekyll-theme-cayman

View File

@ -41,31 +41,47 @@ void doAdvicesChain(
callbackPtr,
&advices,
missCallback = std::move(missCallback)]() mutable {
auto ioLoop = req->getLoop();
if (ioLoop && !ioLoop->isInLoopThread())
{
ioLoop->queueInLoop(
[index,
req,
callbackPtr,
&advices,
missCallback = std::move(missCallback)]() mutable {
doAdvicesChain(advices,
index + 1,
req,
callbackPtr,
std::move(missCallback));
});
return;
}
else
{
doAdvicesChain(advices,
index + 1,
req,
callbackPtr,
std::move(missCallback));
}
doAdvicesChain(advices,
index + 1,
req,
callbackPtr,
std::move(missCallback));
});
}
else
{
missCallback();
}
}
void doAdvicesChain(
const std::deque<std::function<void(const HttpRequestPtr &,
AdviceCallback &&,
AdviceChainCallback &&)>> &advices,
size_t index,
const HttpRequestImplPtr &req,
const std::shared_ptr<const std::function<void(const HttpResponsePtr &)>>
&callbackPtr,
std::function<void()> &&missCallback)
{
if (index < advices.size())
{
auto &advice = advices[index];
advice(
req,
[callbackPtr](const HttpResponsePtr &resp) {
(*callbackPtr)(resp);
},
[index,
req,
callbackPtr,
&advices,
missCallback = std::move(missCallback)]() mutable {
doAdvicesChain(advices,
index + 1,
req,
callbackPtr,
std::move(missCallback));
});
}
else

View File

@ -47,30 +47,11 @@ static void doFilterChains(
callbackPtr,
&filters,
missCallback = std::move(missCallback)]() mutable {
auto ioLoop = req->getLoop();
if (ioLoop && !ioLoop->isInLoopThread())
{
ioLoop->queueInLoop([index,
req,
callbackPtr,
&filters,
missCallback = std::move(missCallback),
ioLoop]() mutable {
doFilterChains(filters,
index + 1,
req,
callbackPtr,
std::move(missCallback));
});
}
else
{
doFilterChains(filters,
index + 1,
req,
callbackPtr,
std::move(missCallback));
}
doFilterChains(filters,
index + 1,
req,
callbackPtr,
std::move(missCallback));
});
}
else

16
test.sh
View File

@ -4,7 +4,7 @@ echo "First arg:"
echo $1
os='linux'
if [ "X$1" = "X-w" ]; then
if [ "$1" = "-w" ]; then
os='windows'
fi
@ -12,7 +12,7 @@ src_dir=$(pwd)
echo "OS:" $os
if [ "X$os" = "Xlinux" ]; then
if [ $os = "linux" ]; then
drogon_ctl_exec=$(pwd)/build/drogon_ctl/drogon_ctl
else
drogon_ctl_exec=$(pwd)/build/drogon_ctl/Debug/drogon_ctl.exe
@ -21,7 +21,7 @@ fi
echo ${drogon_ctl_exec}
cd build/lib/tests/
if [ "X$os" = "Xwindows" ]; then
if [ $os = "windows" ]; then
cd Debug
fi
@ -42,7 +42,7 @@ case $(nproc) in
;;
esac
if [ "X$os" = "Xlinux" ]; then
if [ $os = "linux" ]; then
if [ -f /bin/ninja ]; then
cmake_gen='-G Ninja'
else
@ -51,7 +51,7 @@ if [ "X$os" = "Xlinux" ]; then
fi
#Make integration_test_server run as a daemon
if [ "X$os" = "Xlinux" ]; then
if [ $os = "linux" ]; then
sed -i -e "s/\"run_as_daemon.*$/\"run_as_daemon\": true\,/" config.example.json
fi
sed -i -e "s/\"relaunch_on_error.*$/\"relaunch_on_error\": true\,/" config.example.json
@ -131,7 +131,7 @@ cd ../views
echo "Hello, world!" >>hello.csp
cd ../build
if [ "X$os" = "Xwindows" ]; then
if [ $os = "windows" ]; then
cmake_gen="$cmake_gen -DCMAKE_TOOLCHAIN_FILE=$src_dir/conan_toolchain.cmake \
-DCMAKE_PREFIX_PATH=$src_dir/install \
-DCMAKE_POLICY_DEFAULT_CMP0091=NEW \
@ -151,7 +151,7 @@ if [ $? -ne 0 ]; then
exit -1
fi
if [ "X$os" = "Xlinux" ]; then
if [ $os = "linux" ]; then
if [ ! -f "drogon_test" ]; then
echo "Failed to build drogon_test"
exit -1
@ -166,7 +166,7 @@ fi
cd ../../
rm -rf drogon_test
if [ "X$1" = "X-t" ]; then
if [ "$1" = "-t" ]; then
#unit testing
cd ../../
echo "Unit testing"

@ -1 +1 @@
Subproject commit e50b4162de48717a569ccd5c6f31c1e9a9b6374b
Subproject commit 85a2a212102718fe3973b2ae183c75afdffc83a3