* From inside: close by us, statistics, ...
* From outside: timeout, EOF, close by external reasons, ... */
bool defer_accounting_here = false;
- if (!defer_sample_is_accounting() && s->stream && !s->outgoing) {
+ if (!defer_sample_is_accounting()) {
defer_sample_start(NULL);
defer_accounting_here = true;
}
worker_task_finalize(t, KR_STATE_FAIL);
worker_task_unref(t);
the_worker->stats.timeout += 1;
- if (s->closing)
+ if (s->closing) {
+ defer_sample_stop(&defer_prev_sample_state, true);
return PROTOLAYER_EVENT_PROPAGATE;
+ }
defer_sample_restart();
} while (!session2_waitinglist_is_empty(s));
defer_sample_stop(&defer_prev_sample_state, true);