queue_ix,
age_ns / 1000000.0);
+ if (ctx->session->closing) {
+ VERBOSE_LOG(" BREAK (session is closing)\n");
+ protolayer_break(ctx, kr_error(ECANCELED));
+ return;
+ }
if (age_ns >= REQ_TIMEOUT) {
- VERBOSE_LOG(" BREAK\n");
+ VERBOSE_LOG(" BREAK (timeout)\n");
protolayer_break(ctx, kr_error(ETIME));
return;
}
// but we may not know the client's IP yet.
// Note two cases: incoming session (new request)
// vs. outgoing session (resuming work on some request)
- if (direction == PROTOLAYER_UNWRAP)
+ if ((direction == PROTOLAYER_UNWRAP) && (layer_ix == 0))
defer_sample_start();
int ret;
}
ret = protolayer_step(ctx);
- if (direction == PROTOLAYER_UNWRAP)
+ if ((direction == PROTOLAYER_UNWRAP) && (layer_ix == 0))
defer_sample_stop();
return ret;
}