Crypt-Bear

 view release on metacpan or  search on metacpan

include/bearssl_ssl.h  view on Meta::CPAN

3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
*                The 'len' parameter is guaranteed never to exceed 20000,
 *                so the length always fits in an 'int' on all platforms.
 *
 *  low_write()   write up to 'len' bytes, to be read from data[]. The
 *                returned value is the number of written bytes, or -1 on
 *                error. The 'len' parameter is guaranteed never to exceed
 *                20000, so the length always fits in an 'int' on all
 *                parameters.
 *
 * A socket closure (if the transport medium is a socket) should be reported
 * as an error (-1). The callbacks shall endeavour to block until at least
 * one byte can be read or written; a callback returning 0 at times is
 * acceptable, but this normally leads to the callback being immediately
 * called again, so the callback should at least always try to block for
 * some time if no I/O can take place.
 *
 * The SSL engine naturally applies some buffering, so the callbacks need
 * not apply buffers of their own.
 */
/**
 * \brief Context structure for the simplified SSL I/O wrapper.
 *
 * This structure is initialised with `br_sslio_init()`. Its contents
 * are opaque and shall not be accessed directly.
 */
typedef struct {
#ifndef BR_DOXYGEN_IGNORE

include/bearssl_ssl.h  view on Meta::CPAN

3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
*     the transport medium. Read bytes shall be written in `data`.
*
*   - `low_write()` writes at least one byte, at most `len` bytes, unto
*     the transport medium. The bytes to write are read from `data`.
*
*   - The `len` parameter is never zero, and is always lower than 20000.
*
*   - The number of processed bytes (read or written) is returned. Since
*     that number is less than 20000, it always fits on an `int`.
*
*   - On error, the callbacks return -1. Reaching end-of-stream is an
*     error. Errors are permanent: the SSL connection is terminated.
*
*   - Callbacks SHOULD NOT return 0. This is tolerated, as long as
*     callbacks endeavour to block for some non-negligible amount of
*     time until at least one byte can be sent or received (if a
*     callback returns 0, then the wrapper invokes it again
*     immediately).
*
*   - Callbacks MAY return as soon as at least one byte is processed;
*     they MAY also insist on reading or writing _all_ requested bytes.
*     Since SSL is a self-terminated protocol (each record has a length
*     header), this does not change semantics.
*
*   - Callbacks need not apply any buffering (for performance) since SSL



( run in 0.311 second using v1.01-cache-2.11-cpan-709fd43a63f )