... and simplify the corresponding code.
The previous branch commit missed a callException() case that stops the
job but should not be reported as a BUG related to callback maintenance
(it would be up to the callException() implementation to decide how to
report the caught exception). There might be (or there will) be other,
similar cases where the job is stopped prematurely for some non-BUG
reason beyond swanSong() knowledge.
{
debugs(33, 6, this);
- if (callback_) {
- // External callback cancellation makes our doneAll() true and, hence,
- // may get us here. That outcome is not a bug.
- if (!callback_->canceled()) {
- debugs(83, DBG_IMPORTANT, "BUG: Unexpected state while downloading " << url_);
- callBack(Http::scInternalServerError);
- }
- callback_ = nullptr;
- }
+ if (callback_) // job-ending emergencies like noteAbort() or callException()
+ callBack(Http::scInternalServerError);
if (context_) {
context_->finished();