]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
let the application get the retry timers
authorAlan T. DeKok <aland@freeradius.org>
Wed, 6 Mar 2024 16:28:53 +0000 (11:28 -0500)
committerAlan T. DeKok <aland@freeradius.org>
Wed, 6 Mar 2024 16:28:53 +0000 (11:28 -0500)
src/lib/bio/retry.c
src/lib/bio/retry.h

index ad116db35e6ff872eeedd3828afba57a58544b34..18b3e7d4ed61c0747c7c2d52e568c98e55851f86 100644 (file)
@@ -627,6 +627,20 @@ int fr_bio_retry_entry_start(UNUSED fr_bio_t *bio, fr_bio_retry_entry_t *item, f
        return 0;
 }
 
+/**  Allow the callbacks / application to know when things are being retried.
+ *
+ *  This is not initialized util _after_ fr_bio_retry_entry_start() has been called.
+ */
+const fr_retry_t *fr_bio_retry_entry_info(UNUSED fr_bio_t *bio, fr_bio_retry_entry_t *item)
+{
+       fr_assert(item->buffer != NULL);
+
+       if (!item->retry.config) return NULL;
+
+       return &item->retry;
+}
+
+
 /**  Cancel all outstanding packets.
  *
  */
index 5c23d3b1abdabe96b458743b1c4d578561326742..7f09768c4b888845972169bf037c96792b903338 100644 (file)
@@ -112,4 +112,6 @@ int         fr_bio_retry_entry_cancel(fr_bio_t *bio, fr_bio_retry_entry_t *retry_ctx) C
 
 int            fr_bio_retry_entry_start(fr_bio_t *bio, fr_bio_retry_entry_t *retry_ctx, fr_retry_config_t const *cfg) CC_HINT(nonnull);
 
+const fr_retry_t *fr_bio_retry_entry_info(fr_bio_t *bio, fr_bio_retry_entry_t *retry_ctx) CC_HINT(nonnull);
+
 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));