Skip to content

Instantly share code, notes, and snippets.

@rgs1
Created June 29, 2022 13:43
Show Gist options
  • Save rgs1/6324da4e802b275b6823d5c60e93ada9 to your computer and use it in GitHub Desktop.
Save rgs1/6324da4e802b275b6823d5c60e93ada9 to your computer and use it in GitHub Desktop.
// en source/extensions/transport_sockets/tls/io_handle_bio.cc
// NOLINTNEXTLINE(readability-identifier-naming)
int io_handle_read(BIO* b, char* out, int outl) {
if (out == nullptr) {
return 0;
}
Buffer::BufferFragmentImpl fragment(out, outl,
[](const void*, size_t,
const Envoy::Buffer::BufferFragmentImpl* this_fragment) {
delete this_fragment;
});
Buffer::OwnedImpl buffer;
buffer.addBufferFragment(fragment);
auto result = bio_io_handle(b)->read(buffer, outl);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment