#define BIO_get_buffer_num_lines(b) \ BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL) #define BIO_set_read_buffer_size(b,size) \ BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0) #define BIO_set_write_buffer_size(b,size) \ BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1) #define BIO_set_buffer_size(b,size) \ BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,NULL) #define BIO_set_buffer_read_data(b,buf,num) \ BIO_ctrl(b,BIO_C_SET_BUFF_READ_DATA,num,buf)
BIO_gets(3) by using BIO_read(3) operations on the next BIO in the chain. By prepending a buffering BIO to a chain it is therefore possible to provide BIO_gets(3) functionality if the following BIOs do not support it (for example SSL BIOs).Data is only written to the next BIO in the chain when the write buffer fills or when BIO_flush(3) is called. It is therefore important to call BIO_flush(3) whenever any pending data should be written such as when removing a buffering BIO using BIO_pop(3). BIO_flush(3) may need to be retried if the ultimate source/sink BIO is non blocking.