Skip to content

Commit 314fe6b

Browse files
committed
[FOLD]
1 parent 81a8bd1 commit 314fe6b

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

include/boost/http_io/server/workers.hpp

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,15 @@ class workers
100100
endpoint const& ep,
101101
bool reuse_addr = true)
102102
{
103-
ve_.emplace_back(concurrency_, ex_, ep, reuse_addr);
103+
va_.emplace_back(concurrency_, ex_, ep, reuse_addr);
104104
}
105105

106106
private:
107-
struct entry
107+
struct acceptor
108108
{
109109
template<class... Args>
110110
explicit
111-
entry(
111+
acceptor(
112112
unsigned concurrency,
113113
Args&&... args)
114114
: sock(std::forward<Args>(args)...)
@@ -140,13 +140,13 @@ class workers
140140
void stop() override;
141141
void do_idle(void*) override;
142142
void do_accepts();
143-
void on_accept(entry* e, worker* w,
144-
system::error_code const& ec);
143+
void on_accept(acceptor*, worker*,
144+
system::error_code const&);
145145
void do_stop();
146146

147147
Executor ex_;
148148
fixed_array<worker> vw_;
149-
std::vector<entry> ve_;
149+
std::vector<acceptor> va_;
150150
worker* idle_ = nullptr;
151151

152152
std::size_t n_idle_ = 0;
@@ -178,13 +178,13 @@ workers(
178178
template<class Executor, class Worker>
179179
void
180180
workers<Executor, Worker>::
181-
do_idle(void* p)
181+
do_idle(void* pw)
182182
{
183183
asio::dispatch(ex_,
184-
[this, p]()
184+
[this, pw]()
185185
{
186186
worker* w = vw_.data() +
187-
reinterpret_cast<std::uintptr_t>(p) /
187+
reinterpret_cast<std::uintptr_t>(pw) /
188188
reinterpret_cast<std::uintptr_t>(vw_.data());
189189
// push
190190
w->next = idle_;
@@ -217,19 +217,19 @@ do_accepts()
217217
BOOST_ASSERT(ex_.running_in_this_thread());
218218
if(idle_)
219219
{
220-
for(auto& e : ve_)
220+
for(auto& a : va_)
221221
{
222-
while(e.need > 0)
222+
while(a.need > 0)
223223
{
224-
--e.need;
225-
LOG_TRC(sect_, "need=", e.need);
224+
--a.need;
225+
LOG_TRC(sect_, "need=", a.need);
226226
// pop
227-
auto w = idle_;
227+
auto pw = idle_;
228228
idle_ = idle_->next;
229229
--n_idle_;
230230
LOG_TRC(sect_, "n_idle=", n_idle_);
231-
e.sock.async_accept(w->w.socket(), w->w.endpoint(),
232-
asio::prepend(call_mf(&workers::on_accept, this), &e, w));
231+
a.sock.async_accept(pw->w.socket(), pw->w.endpoint(),
232+
asio::prepend(call_mf(&workers::on_accept, this), &a, pw));
233233
if(! idle_)
234234
goto busy;
235235
}
@@ -246,25 +246,25 @@ template<class Executor, class Worker>
246246
void
247247
workers<Executor, Worker>::
248248
on_accept(
249-
entry* e,
250-
worker* w,
249+
acceptor* pa,
250+
worker* pw,
251251
system::error_code const& ec)
252252
{
253-
++e->need;
254-
LOG_TRC(sect_, "need=", e->need);
253+
++pa->need;
254+
LOG_TRC(sect_, "need=", pa->need);
255255
if(ec.failed())
256256
{
257257
// push
258-
w->next = idle_;
259-
idle_ = w;
258+
pw->next = idle_;
259+
idle_ = pw;
260260
++n_idle_;
261261
LOG_TRC(sect_, "n_idle=", n_idle_);
262262
LOG_DBG(sect_, "async_accept: ", ec.message());
263263
return do_accepts();
264264
}
265265
do_accepts();
266-
asio::dispatch(w->w.socket().get_executor(),
267-
call_mf(&Worker::on_accept, &w->w));
266+
asio::dispatch(pw->w.socket().get_executor(),
267+
call_mf(&Worker::on_accept, &pw->w));
268268
}
269269

270270
template<class Executor, class Worker>
@@ -274,10 +274,10 @@ do_stop()
274274
{
275275
for(auto& w : vw_)
276276
w.w.cancel();
277-
for(auto& e : ve_)
277+
for(auto& a : va_)
278278
{
279279
system::error_code ec;
280-
e.sock.cancel(ec); // error ignored
280+
a.sock.cancel(ec); // error ignored
281281
}
282282
}
283283

0 commit comments

Comments
 (0)