for (/* nothing */; this != NULL; this = fr_bio_next(this)) {
my = (fr_bio_common_t *) this;
- if (!my->priv_cb.shutdown) continue;
-
- /*
- * The EOF handler said it's NOT at EOF, so we stop processing here.
- */
- my->priv_cb.shutdown(&my->bio);
- my->priv_cb.shutdown = NULL;
+ if (my->priv_cb.shutdown) {
+ my->priv_cb.shutdown(&my->bio);
+ my->priv_cb.shutdown = NULL;
+ }
my->bio.read = fr_bio_shutdown_read;
my->bio.write = fr_bio_shutdown_write;
+ talloc_set_destructor(my, NULL);
}
/*
return -1;
}
-/*
- * The application can read from the BIO until EOF, but cannot write to it.
- */
-static void fr_bio_mem_shutdown(fr_bio_t *bio)
-{
- bio->read = fr_bio_mem_read_eof;
- bio->write = fr_bio_null_write;
-}
-
/** Allocate a memory buffer bio for either reading or writing.
*/
static bool fr_bio_mem_buf_alloc(fr_bio_mem_t *my, fr_bio_buf_t *buf, size_t size)
* just doing packet verification/
*/
my->priv_cb.eof = fr_bio_mem_eof;
- my->priv_cb.shutdown = fr_bio_mem_shutdown;
}
fr_bio_chain(&my->bio, next);
/*
* @todo - have write pause / write resume callbacks?
*/
- my->priv_cb.shutdown = fr_bio_mem_shutdown;
fr_bio_chain(&my->bio, next);