Skip to content

Commit 1023838

Browse files
committed
F
1 parent 327f1b2 commit 1023838

File tree

1 file changed

+19
-19
lines changed

1 file changed

+19
-19
lines changed

lib/src/AOPAdvice.cc

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@
2020
namespace drogon
2121
{
2222

23-
static void doAdvicesChain(
23+
static void doAdviceChain(
2424
const std::vector<std::function<void(const HttpRequestPtr &,
2525
AdviceCallback &&,
26-
AdviceChainCallback &&)>> &advice,
26+
AdviceChainCallback &&)>> &adviceChain,
2727
size_t index,
2828
const HttpRequestImplPtr &req,
2929
std::shared_ptr<const std::function<void(const HttpResponsePtr &)>>
@@ -88,7 +88,7 @@ void AopAdvice::passPreRoutingAdvices(
8888

8989
auto callbackPtr =
9090
std::make_shared<std::decay_t<decltype(callback)>>(std::move(callback));
91-
doAdvicesChain(preRoutingAdvices_, 0, req, std::move(callbackPtr));
91+
doAdviceChain(preRoutingAdvices_, 0, req, std::move(callbackPtr));
9292
}
9393

9494
void AopAdvice::passPostRoutingObservers(const HttpRequestImplPtr &req) const
@@ -114,7 +114,7 @@ void AopAdvice::passPostRoutingAdvices(
114114

115115
auto callbackPtr =
116116
std::make_shared<std::decay_t<decltype(callback)>>(std::move(callback));
117-
doAdvicesChain(postRoutingAdvices_, 0, req, std::move(callbackPtr));
117+
doAdviceChain(postRoutingAdvices_, 0, req, std::move(callbackPtr));
118118
}
119119

120120
void AopAdvice::passPreHandlingObservers(const HttpRequestImplPtr &req) const
@@ -140,7 +140,7 @@ void AopAdvice::passPreHandlingAdvices(
140140

141141
auto callbackPtr =
142142
std::make_shared<std::decay_t<decltype(callback)>>(std::move(callback));
143-
doAdvicesChain(preHandlingAdvices_, 0, req, std::move(callbackPtr));
143+
doAdviceChain(preHandlingAdvices_, 0, req, std::move(callbackPtr));
144144
}
145145

146146
void AopAdvice::passPostHandlingAdvices(const HttpRequestImplPtr &req,
@@ -161,43 +161,43 @@ void AopAdvice::passPreSendingAdvices(const HttpRequestImplPtr &req,
161161
}
162162
}
163163

164-
static void doAdvicesChain(
164+
static void doAdviceChain(
165165
const std::vector<std::function<void(const HttpRequestPtr &,
166166
AdviceCallback &&,
167-
AdviceChainCallback &&)>> &advice,
167+
AdviceChainCallback &&)>> &adviceChain,
168168
size_t index,
169169
const HttpRequestImplPtr &req,
170170
std::shared_ptr<const std::function<void(const HttpResponsePtr &)>>
171171
&&callbackPtr)
172172
{
173-
if (index < advice.size())
173+
if (index < adviceChain.size())
174174
{
175-
auto &advice = advice[index];
175+
auto &advice = adviceChain[index];
176176
advice(
177177
req,
178178
[/*copy*/ callbackPtr](const HttpResponsePtr &resp) {
179179
(*callbackPtr)(resp);
180180
},
181-
[index, req, callbackPtr, &advice]() mutable {
181+
[index, req, callbackPtr, &adviceChain]() mutable {
182182
auto ioLoop = req->getLoop();
183183
if (ioLoop && !ioLoop->isInLoopThread())
184184
{
185185
ioLoop->queueInLoop([index,
186186
req,
187187
callbackPtr = std::move(callbackPtr),
188-
&advice]() mutable {
189-
doAdvicesChain(advice,
190-
index + 1,
191-
req,
192-
std::move(callbackPtr));
188+
&adviceChain]() mutable {
189+
doAdviceChain(adviceChain,
190+
index + 1,
191+
req,
192+
std::move(callbackPtr));
193193
});
194194
}
195195
else
196196
{
197-
doAdvicesChain(advice,
198-
index + 1,
199-
req,
200-
std::move(callbackPtr));
197+
doAdviceChain(adviceChain,
198+
index + 1,
199+
req,
200+
std::move(callbackPtr));
201201
}
202202
});
203203
}

0 commit comments

Comments
 (0)