static inline void defer_sample_start_stamp(uint64_t stamp)
{
if (!defer) return;
- if (defer_sample_state.is_accounting) return;
+ kr_assert(!defer_sample_state.is_accounting);
defer_sample_state.is_accounting = true;
defer_sample_state.stamp = stamp;
defer_sample_state.addr.ip.sa_family = AF_UNSPEC;
static inline void defer_sample_stop_stamp(uint64_t stamp)
{
if (!defer) return;
- // kr_assert(defer_sample_state.is_accounting);
+ kr_assert(defer_sample_state.is_accounting);
defer_sample_state.is_accounting = false;
if (defer_sample_state.addr.ip.sa_family == AF_UNSPEC) 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) && (layer_ix == 0))
+ if ((direction == PROTOLAYER_UNWRAP) && (layer_ix == 0) &&
+ session->proto != KR_PROTO_DOQ_STREAM &&
+ session->proto != KR_PROTO_DOQ)
defer_sample_start(NULL);
struct protolayer_iter_ctx *ctx = malloc(session->iter_ctx_size);
}
int ret = protolayer_step(ctx);
- if ((direction == PROTOLAYER_UNWRAP) && (layer_ix == 0))
+ if ((direction == PROTOLAYER_UNWRAP) && (layer_ix == 0) &&
+ session->proto != KR_PROTO_DOQ_STREAM &&
+ session->proto != KR_PROTO_DOQ)
defer_sample_stop(NULL, false);
return ret;
}