From: Alan T. DeKok Date: Mon, 19 Dec 2016 18:29:33 +0000 (-0500) Subject: added master ctx set/get X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=38cd6749dcad683edf18e1bf4598e0f0ebdafe3a;p=thirdparty%2Ffreeradius-server.git added master ctx set/get --- diff --git a/src/util/channel.c b/src/util/channel.c index a57ba5ab3db..36cf50a6859 100644 --- a/src/util/channel.c +++ b/src/util/channel.c @@ -751,6 +751,35 @@ void *fr_channel_worker_ctx_get(fr_channel_t *ch) } +/** Add master-specific data to a channel + * + * @param[in] ch the channel + * @param[in] ctx the context to add. + */ +void fr_channel_master_ctx_add(fr_channel_t *ch, void *ctx) +{ +#ifndef NDEBUG + talloc_get_type_abort(ch, fr_channel_t); +#endif + + ch->end[TO_WORKER].ctx = ctx; +} + + +/** Get master-specific data from a channel + * + * @param[in] ch the channel + */ +void *fr_channel_master_ctx_get(fr_channel_t *ch) +{ +#ifndef NDEBUG + talloc_get_type_abort(ch, fr_channel_t); +#endif + + return ch->end[TO_WORKER].ctx; +} + + /** Send a channel to a KQ * * @param[in] ch the channel diff --git a/src/util/channel.h b/src/util/channel.h index f424f572e45..1d3189604b2 100644 --- a/src/util/channel.h +++ b/src/util/channel.h @@ -128,6 +128,8 @@ int fr_channel_worker_ack_close(fr_channel_t *ch) CC_HINT(nonnull); void fr_channel_worker_ctx_add(fr_channel_t *ch, void *ctx) CC_HINT(nonnull); void *fr_channel_worker_ctx_get(fr_channel_t *ch) CC_HINT(nonnull); +void fr_channel_master_ctx_add(fr_channel_t *ch, void *ctx) CC_HINT(nonnull); +void *fr_channel_master_ctx_get(fr_channel_t *ch) CC_HINT(nonnull); void fr_channel_debug(fr_channel_t *ch, FILE *fp);