Lines Matching full:bio
7 BIO_get_mem_ptr, BIO_new_mem_buf - memory BIO
11 #include <openssl/bio.h>
17 BIO_set_mem_eof_return(BIO *b, int v);
18 long BIO_get_mem_data(BIO *b, char **pp);
19 BIO_set_mem_buf(BIO *b, BUF_MEM *bm, int c);
20 BIO_get_mem_ptr(BIO *b, BUF_MEM **pp);
22 BIO *BIO_new_mem_buf(const void *buf, int len);
26 BIO_s_mem() returns the memory BIO method function.
28 A memory BIO is a source/sink BIO which uses memory for its I/O. Data
29 written to a memory BIO is stored in a BUF_MEM structure which is extended
35 BIO_s_dgram_mem() is a memory BIO that respects datagram semantics. A single
36 call to L<BIO_write(3)> will write a single datagram to the memory BIO. A
47 when there are no datagrams in the BIO to read will return a negative result and
49 true). A datagram mem BIO will never return true from L<BIO_eof(3)>.
51 Any data written to a memory BIO can be recalled by reading from it.
52 Unless the memory BIO is read only any data read from it is deleted from
53 the BIO.
61 If the BIO_CLOSE flag is set when a memory BIO is freed then the underlying
64 Calling BIO_reset() on a read write memory BIO clears any data in it if the
67 data can be read again. On a read only BIO it similarly restores the BIO to
70 BIO_eof() is true if no data is in the BIO.
74 BIO_set_mem_eof_return() sets the behaviour of memory BIO B<b> when it is
75 empty. If the B<v> is zero then an empty memory BIO will return EOF (that is
94 BIO_new_mem_buf() creates a memory BIO using B<len> bytes of data at B<buf>,
96 length is determined by B<strlen>. The BIO is set to a read only state and
98 made available from a static area of memory in the form of a BIO. The
100 first, so the supplied area of memory must be unchanged until the BIO is freed.
114 to a read write memory BIO will have to move the unread data with an internal
115 copy operation, if a BIO contains a lot of data and it is read in small
117 a buffering BIO to the chain can speed up the process.
119 Calling BIO_set_mem_buf() on a secmem or dgram BIO will give undefined results,
122 Switching a memory BIO from read write to read only is not supported and
125 immediately after BIO creation and set the BIO as read only.
127 The other supported sequence is to start with a read write BIO then temporarily
128 switch it to read only and call BIO_reset() on the read only BIO immediately
129 before switching it back to read write. Before the BIO is freed it must be
132 Calling BIO_get_mem_ptr() on read only BIO will return a BUF_MEM that
134 BIO is set to BIO_NOCLOSE, before freeing the BUF_MEM the data pointer
138 Calling BIO_reset() on a read write memory BIO with BIO_FLAGS_NONCLEAR_RST
140 BIO are intertwined. As documented above the BIO will be reset to the
148 BIO, _not_ its actual data buffer. See the examples section for the proper
162 BIO_new_mem_buf() returns a valid B<BIO> structure on success or NULL on error.
166 Create a memory BIO and write some data to it:
168 BIO *mem = BIO_new(BIO_s_mem());
172 Create a read only memory BIO:
175 BIO *mem = BIO_new_mem_buf(data, -1);
177 Extract the BUF_MEM structure from a memory BIO and then free up the BIO:
185 Extract the BUF_MEM ptr, claim ownership of the internal data and free the BIO
191 BIO_get_mem_data(bio, &data);
192 BIO_get_mem_ptr(bio, &bptr);
194 BIO_free(bio);