diff options
author | schwarze <> | 2015-02-14 14:09:01 +0000 |
---|---|---|
committer | schwarze <> | 2015-02-14 14:09:01 +0000 |
commit | 88853a20be023939d14cfde9e86a81bfcc75ef7b (patch) | |
tree | 14e96de4625e6c5d8612c27a513ebf5ed519b352 /src/lib/libcrypto/man/BIO_f_buffer.3 | |
parent | 948b14a55ded39aea589e34e23c19085fd99cac5 (diff) | |
download | openbsd-88853a20be023939d14cfde9e86a81bfcc75ef7b.tar.gz openbsd-88853a20be023939d14cfde9e86a81bfcc75ef7b.tar.bz2 openbsd-88853a20be023939d14cfde9e86a81bfcc75ef7b.zip |
second batch of perlpod(1) to mdoc(7) conversion
Diffstat (limited to 'src/lib/libcrypto/man/BIO_f_buffer.3')
-rw-r--r-- | src/lib/libcrypto/man/BIO_f_buffer.3 | 110 |
1 files changed, 110 insertions, 0 deletions
diff --git a/src/lib/libcrypto/man/BIO_f_buffer.3 b/src/lib/libcrypto/man/BIO_f_buffer.3 new file mode 100644 index 0000000000..c01ab4809b --- /dev/null +++ b/src/lib/libcrypto/man/BIO_f_buffer.3 | |||
@@ -0,0 +1,110 @@ | |||
1 | .Dd July 17, 2014 | ||
2 | .Dt BIO_F_BUFFER 3 | ||
3 | .Os | ||
4 | .Sh NAME | ||
5 | .Nm BIO_f_buffer | ||
6 | .Nd buffering BIO | ||
7 | .Sh SYNOPSIS | ||
8 | .In openssl/bio.h | ||
9 | .Ft BIO_METHOD * | ||
10 | .Fo BIO_f_buffer | ||
11 | .Fa void | ||
12 | .Fc | ||
13 | .Bd -literal | ||
14 | #define BIO_get_buffer_num_lines(b) \e | ||
15 | BIO_ctrl(b,BIO_C_GET_BUFF_NUM_LINES,0,NULL) | ||
16 | #define BIO_set_read_buffer_size(b,size) \e | ||
17 | BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,0) | ||
18 | #define BIO_set_write_buffer_size(b,size) \e | ||
19 | BIO_int_ctrl(b,BIO_C_SET_BUFF_SIZE,size,1) | ||
20 | #define BIO_set_buffer_size(b,size) \e | ||
21 | BIO_ctrl(b,BIO_C_SET_BUFF_SIZE,size,NULL) | ||
22 | #define BIO_set_buffer_read_data(b,buf,num) \e | ||
23 | BIO_ctrl(b,BIO_C_SET_BUFF_READ_DATA,num,buf) | ||
24 | .Ed | ||
25 | .Sh DESCRIPTION | ||
26 | .Fn BIO_f_buffer | ||
27 | returns the buffering BIO method. | ||
28 | .Pp | ||
29 | Data written to a buffering BIO is buffered and periodically written | ||
30 | to the next BIO in the chain. | ||
31 | Data read from a buffering BIO comes from an internal buffer | ||
32 | which is filled from the next BIO in the chain. | ||
33 | Both | ||
34 | .Xr BIO_gets 3 | ||
35 | and | ||
36 | .Xr BIO_puts 3 | ||
37 | are supported. | ||
38 | .Pp | ||
39 | Calling | ||
40 | .Xr BIO_reset 3 | ||
41 | on a buffering BIO clears any buffered data. | ||
42 | .Pp | ||
43 | .Fn BIO_get_buffer_num_lines | ||
44 | returns the number of lines currently buffered. | ||
45 | .Pp | ||
46 | .Fn BIO_set_read_buffer_size , | ||
47 | .Fn BIO_set_write_buffer_size , | ||
48 | and | ||
49 | .Fn BIO_set_buffer_size | ||
50 | set the read, write or both read and write buffer sizes to | ||
51 | .Fa size . | ||
52 | The initial buffer size is | ||
53 | .Dv DEFAULT_BUFFER_SIZE , | ||
54 | currently 4096. | ||
55 | Any attempt to reduce the buffer size below | ||
56 | .Dv DEFAULT_BUFFER_SIZE | ||
57 | is ignored. | ||
58 | Any buffered data is cleared when the buffer is resized. | ||
59 | .Pp | ||
60 | .Fn BIO_set_buffer_read_data | ||
61 | clears the read buffer and fills it with | ||
62 | .Fa num | ||
63 | bytes of | ||
64 | .Fa buf . | ||
65 | If | ||
66 | .Fa num | ||
67 | is larger than the current buffer size the buffer is expanded. | ||
68 | .Sh NOTES | ||
69 | Buffering BIOs implement | ||
70 | .Xr BIO_gets 3 | ||
71 | by using | ||
72 | .Xr BIO_read 3 | ||
73 | operations on the next BIO in the chain. | ||
74 | By prepending a buffering BIO to a chain | ||
75 | it is therefore possible to provide | ||
76 | .Xr BIO_gets 3 | ||
77 | functionality if the following BIOs do not support it (for example SSL BIOs). | ||
78 | .Pp | ||
79 | Data is only written to the next BIO in the chain | ||
80 | when the write buffer fills or when | ||
81 | .Xr BIO_flush 3 | ||
82 | is called. | ||
83 | It is therefore important to call | ||
84 | .Xr BIO_flush 3 | ||
85 | whenever any pending data should be written | ||
86 | such as when removing a buffering BIO using | ||
87 | .Xr BIO_pop 3 . | ||
88 | .Xr BIO_flush 3 | ||
89 | may need to be retried if the ultimate source/sink BIO is non blocking. | ||
90 | .Sh RETURN VALUES | ||
91 | .Fn BIO_f_buffer | ||
92 | returns the buffering BIO method. | ||
93 | .Pp | ||
94 | .Fn BIO_get_buffer_num_lines | ||
95 | returns the number of lines buffered (may be 0). | ||
96 | .Pp | ||
97 | .Fn BIO_set_read_buffer_size , | ||
98 | .Fn BIO_set_write_buffer_size , | ||
99 | and | ||
100 | .Fn BIO_set_buffer_size | ||
101 | return 1 if the buffer was successfully resized or 0 for failure. | ||
102 | .Pp | ||
103 | .Fn BIO_set_buffer_read_data | ||
104 | returns 1 if the data was set correctly or 0 if there was an error. | ||
105 | .Sh SEE ALSO | ||
106 | .Xr BIO 3 , | ||
107 | .Xr BIO_ctrl 3 , | ||
108 | .Xr BIO_flush 3 , | ||
109 | .Xr BIO_pop 3 , | ||
110 | .Xr BIO_reset 3 | ||