Skip to content

Commit 5b83319

Browse files
authored
docs: Specify the return value of S2N_FAILURE for IO APIs (#4446)
1 parent 025f3b2 commit 5b83319

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

api/s2n.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2008,7 +2008,7 @@ S2N_API extern int s2n_negotiate(struct s2n_connection *conn, s2n_blocked_status
20082008
* @param buf A pointer to a buffer that s2n will write data from
20092009
* @param size The size of buf
20102010
* @param blocked A pointer which will be set to the blocked status if an `S2N_ERR_T_BLOCKED` error is returned.
2011-
* @returns The number of bytes written, and may indicate a partial write
2011+
* @returns The number of bytes written on success, which may indicate a partial write. S2N_FAILURE on failure.
20122012
*/
20132013
S2N_API extern ssize_t s2n_send(struct s2n_connection *conn, const void *buf, ssize_t size, s2n_blocked_status *blocked);
20142014

@@ -2021,7 +2021,7 @@ S2N_API extern ssize_t s2n_send(struct s2n_connection *conn, const void *buf, ss
20212021
* @param bufs A pointer to a vector of buffers that s2n will write data from.
20222022
* @param count The number of buffers in `bufs`
20232023
* @param blocked A pointer which will be set to the blocked status if an `S2N_ERR_T_BLOCKED` error is returned.
2024-
* @returns The number of bytes written, and may indicate a partial write.
2024+
* @returns The number of bytes written on success, which may indicate a partial write. S2N_FAILURE on failure.
20252025
*/
20262026
S2N_API extern ssize_t s2n_sendv(struct s2n_connection *conn, const struct iovec *bufs, ssize_t count, s2n_blocked_status *blocked);
20272027

@@ -2040,7 +2040,7 @@ S2N_API extern ssize_t s2n_sendv(struct s2n_connection *conn, const struct iovec
20402040
* @param count The number of buffers in `bufs`
20412041
* @param offs The write cursor offset. This should be updated as data is written. See the example code.
20422042
* @param blocked A pointer which will be set to the blocked status if an `S2N_ERR_T_BLOCKED` error is returned.
2043-
* @returns The number of bytes written, and may indicate a partial write.
2043+
* @returns The number of bytes written on success, which may indicate a partial write. S2N_FAILURE on failure.
20442044
*/
20452045
S2N_API extern ssize_t s2n_sendv_with_offset(struct s2n_connection *conn, const struct iovec *bufs, ssize_t count, ssize_t offs, s2n_blocked_status *blocked);
20462046

@@ -2057,7 +2057,7 @@ S2N_API extern ssize_t s2n_sendv_with_offset(struct s2n_connection *conn, const
20572057
* @param buf A pointer to a buffer that s2n will place read data into.
20582058
* @param size Size of `buf`
20592059
* @param blocked A pointer which will be set to the blocked status if an `S2N_ERR_T_BLOCKED` error is returned.
2060-
* @returns number of bytes read. 0 if the connection was shutdown by peer.
2060+
* @returns The number of bytes read on success. 0 if the connection was shutdown by the peer. S2N_FAILURE on failure.
20612061
*/
20622062
S2N_API extern ssize_t s2n_recv(struct s2n_connection *conn, void *buf, ssize_t size, s2n_blocked_status *blocked);
20632063

0 commit comments

Comments
 (0)