diff options
author | Nick Harper <nharper@chromium.org> | 2016-09-23 23:24:09 +0300 |
---|---|---|
committer | David Benjamin <davidben@google.com> | 2016-09-23 23:46:16 +0300 |
commit | 0c0a94d07bedf2db47bcc93dacd1e33e6b17855e (patch) | |
tree | 54b32ab6a7b9207e63cb24383e0d2c1aa5a8166d | |
parent | 16279bc559c36797f6178dfb424fdeb7f895a85f (diff) |
Better explain usage of CBB_flush
The high-level documentation for CBB describes using CBB_flush when a
child goes out of scope, but the function level documentation for
CBB_flush is less clear that CBB_flush will result in the CBB being
safe to use after the children go out of scope.
Change-Id: I58bf9e59a87d2be31a969097455aeeae6381efb3
Reviewed-on: https://boringssl-review.googlesource.com/11261
Reviewed-by: David Benjamin <davidben@google.com>
-rw-r--r-- | include/openssl/bytestring.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/include/openssl/bytestring.h b/include/openssl/bytestring.h index 2985268e..ceb036ee 100644 --- a/include/openssl/bytestring.h +++ b/include/openssl/bytestring.h @@ -327,8 +327,10 @@ OPENSSL_EXPORT void CBB_cleanup(CBB *cbb); OPENSSL_EXPORT int CBB_finish(CBB *cbb, uint8_t **out_data, size_t *out_len); /* CBB_flush causes any pending length prefixes to be written out and any child - * |CBB| objects of |cbb| to be invalidated. It returns one on success or zero - * on error. */ + * |CBB| objects of |cbb| to be invalidated. This allows |cbb| to continue to be + * used after the children go out of scope, e.g. when local |CBB| objects are + * added as children to a |CBB| that persists after a function returns. This + * function returns one on success or zero on error. */ OPENSSL_EXPORT int CBB_flush(CBB *cbb); /* CBB_data returns a pointer to the bytes written to |cbb|. It does not flush |