]> git.ipfire.org Git - thirdparty/bind9.git/commit
Add isc_buffer_setmctx() and isc_buffer_clearmctx() function
authorOndřej Surý <ondrej@isc.org>
Fri, 16 Dec 2022 10:43:20 +0000 (11:43 +0100)
committerOndřej Surý <ondrej@isc.org>
Tue, 20 Dec 2022 18:13:48 +0000 (19:13 +0100)
commite6062ee3ae48d00265c7ebe53e8060fdd644a59b
tree41233e60760b2497ec209a317202a53a440c8f2e
parent8e3a86f6dd568b59673794d3315a47a3bc301d87
Add isc_buffer_setmctx() and isc_buffer_clearmctx() function

Add two extra functions needed by StreamDNS:

1. isc_buffer_setmctx() sets the buffer internal memory context, so we
   can use isc_buffer_reserve() on the buffer.  For this, we also need
   to track whether the .base was dynamically allocated or not.  This
   needs to be called after isc_buffer_init() and before first
   isc_buffer_reserve() call.

2. isc_buffer_clearmctx() clears the buffer internal memory context, and
   frees any dynamically allocated buffer.  This needs to be called
   after the last isc_buffer_reserve() call and before calling the
   isc_buffer_invalidate()
lib/isc/include/isc/buffer.h