Lines Matching full:bio

66 BIO_get_mem_ptr, BIO_new_mem_buf \- memory BIO
70 \& #include <openssl/bio.h>
76 \& BIO_set_mem_eof_return(BIO *b, int v);
77 \& long BIO_get_mem_data(BIO *b, char **pp);
78 \& BIO_set_mem_buf(BIO *b, BUF_MEM *bm, int c);
79 \& BIO_get_mem_ptr(BIO *b, BUF_MEM **pp);
81 \& BIO *BIO_new_mem_buf(const void *buf, int len);
85 \&\fBBIO_s_mem()\fR returns the memory BIO method function.
87 A memory BIO is a source/sink BIO which uses memory for its I/O. Data
88 written to a memory BIO is stored in a BUF_MEM structure which is extended
94 \&\fBBIO_s_dgram_mem()\fR is a memory BIO that respects datagram semantics. A single
95 call to \fBBIO_write\fR\|(3) will write a single datagram to the memory BIO. A
106 when there are no datagrams in the BIO to read will return a negative result and
108 true). A datagram mem BIO will never return true from \fBBIO_eof\fR\|(3).
110 Any data written to a memory BIO can be recalled by reading from it.
111 Unless the memory BIO is read only any data read from it is deleted from
112 the BIO.
120 If the BIO_CLOSE flag is set when a memory BIO is freed then the underlying
123 Calling \fBBIO_reset()\fR on a read write memory BIO clears any data in it if the
126 data can be read again. On a read only BIO it similarly restores the BIO to
129 \&\fBBIO_eof()\fR is true if no data is in the BIO.
133 \&\fBBIO_set_mem_eof_return()\fR sets the behaviour of memory BIO \fBb\fR when it is
134 empty. If the \fBv\fR is zero then an empty memory BIO will return EOF (that is
153 \&\fBBIO_new_mem_buf()\fR creates a memory BIO using \fBlen\fR bytes of data at \fBbuf\fR,
155 length is determined by \fBstrlen\fR. The BIO is set to a read only state and
157 made available from a static area of memory in the form of a BIO. The
159 first, so the supplied area of memory must be unchanged until the BIO is freed.
172 to a read write memory BIO will have to move the unread data with an internal
173 copy operation, if a BIO contains a lot of data and it is read in small
175 a buffering BIO to the chain can speed up the process.
177 Calling \fBBIO_set_mem_buf()\fR on a secmem or dgram BIO will give undefined results,
180 Switching a memory BIO from read write to read only is not supported and
183 immediately after BIO creation and set the BIO as read only.
185 The other supported sequence is to start with a read write BIO then temporarily
186 switch it to read only and call \fBBIO_reset()\fR on the read only BIO immediately
187 before switching it back to read write. Before the BIO is freed it must be
190 Calling \fBBIO_get_mem_ptr()\fR on read only BIO will return a BUF_MEM that
196 Calling \fBBIO_reset()\fR on a read write memory BIO with BIO_FLAGS_NONCLEAR_RST
198 BIO are intertwined. As documented above the BIO will be reset to the
219 \&\fBBIO_new_mem_buf()\fR returns a valid \fBBIO\fR structure on success or NULL on error.
222 Create a memory BIO and write some data to it:
225 \& BIO *mem = BIO_new(BIO_s_mem());
230 Create a read only memory BIO:
234 \& BIO *mem = BIO_new_mem_buf(data, \-1);
237 Extract the BUF_MEM structure from a memory BIO and then free up the BIO:
247 Extract the BUF_MEM ptr, claim ownership of the internal data and free the BIO
254 \& BIO_get_mem_data(bio, &data);
255 \& BIO_get_mem_ptr(bio, &bptr);
257 \& BIO_free(bio);