MCPcopy Create free account
hub / github.com/aria2/aria2 / shouldProcess

Method shouldProcess

src/AbstractCommand.cc:141–177  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

139}
140
141bool AbstractCommand::shouldProcess() const
142{
143 if (checkSocketIsReadable_) {
144 if (readEventEnabled()) {
145 return true;
146 }
147
148 if (socketRecvBuffer_ && !socketRecvBuffer_->bufferEmpty()) {
149 return true;
150 }
151
152 if (socket_ && socket_->getRecvBufferedLength()) {
153 return true;
154 }
155 }
156
157 if (checkSocketIsWritable_ && writeEventEnabled()) {
158 return true;
159 }
160
161#ifdef ENABLE_ASYNC_DNS
162 const auto resolverChecked = asyncNameResolverMan_->resolverChecked();
163 if (resolverChecked && asyncNameResolverMan_->getStatus() != 0) {
164 return true;
165 }
166
167 if (!checkSocketIsReadable_ && !checkSocketIsWritable_ && !resolverChecked) {
168 return true;
169 }
170#else // ENABLE_ASYNC_DNS
171 if (!checkSocketIsReadable_ && !checkSocketIsWritable_) {
172 return true;
173 }
174#endif // ENABLE_ASYNC_DNS
175
176 return noCheck();
177}
178
179bool AbstractCommand::execute()
180{

Callers

nothing calls this directly

Calls 4

bufferEmptyMethod · 0.80
resolverCheckedMethod · 0.80
getRecvBufferedLengthMethod · 0.45
getStatusMethod · 0.45

Tested by

no test coverage detected