From: Alan T. DeKok Date: Wed, 22 May 2024 14:49:09 +0000 (-0400) Subject: expose the fr_retry_t, and add rewrite_ctx X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7e6e7fbdc7baea155ba75aa37771fb3d49d66c39;p=thirdparty%2Ffreeradius-server.git expose the fr_retry_t, and add rewrite_ctx --- diff --git a/src/lib/bio/retry.c b/src/lib/bio/retry.c index 21d8207cf2..3bb3b1c3ac 100644 --- a/src/lib/bio/retry.c +++ b/src/lib/bio/retry.c @@ -43,6 +43,9 @@ struct fr_bio_retry_entry_s { void *uctx; void *packet_ctx; fr_bio_retry_rewrite_t rewrite; //!< per-packet rewrite callback + void *rewrite_ctx; //!< context specifically for rewriting this packet + + fr_retry_t retry; //!< retry timers and counters union { fr_rb_node_t node; //!< for the timers @@ -50,7 +53,6 @@ struct fr_bio_retry_entry_s { }; fr_bio_retry_t *my; //!< so we can get to it from the event timer callback - fr_retry_t retry; //!< retry timers and counters uint8_t const *buffer; size_t size; diff --git a/src/lib/bio/retry.h b/src/lib/bio/retry.h index a53afd4970..ebb8c9eda4 100644 --- a/src/lib/bio/retry.h +++ b/src/lib/bio/retry.h @@ -32,6 +32,15 @@ RCSIDH(lib_bio_retry_h, "$Id$") #include #include +#ifdef _CONST +# error _CONST can only be defined in the local header +#endif +#ifndef _BIO_RETRY_PRIVATE +# define _CONST const +#else +# define _CONST +#endif + typedef struct { fr_event_list_t *el; //!< event list @@ -58,6 +67,8 @@ struct fr_bio_retry_entry_s { void *packet_ctx; //!< packet_ctx from the write() call fr_bio_retry_rewrite_t rewrite; //!< per-packet rewrite callback void *rewrite_ctx; //!< context specifically for rewriting this packet + + fr_retry_t _CONST retry; //!< retry timers and counters }; #endif @@ -137,3 +148,5 @@ const fr_retry_t *fr_bio_retry_entry_info(fr_bio_t *bio, fr_bio_retry_entry_t *r ssize_t fr_bio_retry_rewrite(fr_bio_t *bio, fr_bio_retry_entry_t *retry_ctx, const void *buffer, size_t size) CC_HINT(nonnull(1,2)); fr_bio_retry_info_t const *fr_bio_retry_info(fr_bio_t *bio) CC_HINT(nonnull); + +#undef _CONST