logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

SSL_stream_reset - reset a QUIC stream

Description

       The SSL_stream_reset() function resets the send part of a QUIC stream when called on a QUIC stream SSL
       object, or on a QUIC connection SSL object with  a default stream attached.

       If args is non-NULL, args_len must be set to sizeof(*args).

       quic_error_code is an application-specified error code, which must be in the range [0, 2**62-1]. If args
       is NULL, a value of 0 is used.

       Resetting a stream indicates to an application that the sending part of the stream is terminating
       abnormally. When a stream is reset, the implementation does not guarantee that any data already passed to
       SSL_write(3) will be received by the peer, and data already passed to SSL_write(3) but not yet
       transmitted may or may not be discarded. As such, you should only reset a stream when the information
       transmitted on the stream no longer matters, for example due to an error condition.

       This function cannot be called on a unidirectional stream initiated by the peer, as only the sending side
       of a stream can initiate a stream reset.

       It is also possible to trigger a stream reset by calling SSL_free(3); see the documentation for
       SSL_free(3) for details.

       The receiving part of the stream (for bidirectional streams) continues to function normally.

History

SSL_stream_reset() was added in OpenSSL 3.2.

Name

       SSL_stream_reset - reset a QUIC stream

Notes

       This function corresponds to the QUIC RESET_STREAM frame.

Return Values

       Returns 1 on success and 0 on failure.

       This function fails if called on a QUIC connection SSL object without a default stream attached, or on a
       non-QUIC SSL object.

       After the first call to this function succeeds for a given stream, subsequent calls succeed but are
       ignored. The application error code used is that passed to the first successful call to this function.

See Also

SSL_free(3)

Synopsis

        #include <openssl/ssl.h>

        typedef struct ssl_stream_reset_args_st {
            uint64_t quic_error_code;
        } SSL_STREAM_RESET_ARGS;

        int SSL_stream_reset(SSL *ssl,
                             const SSL_STREAM_RESET_ARGS *args,
                             size_t args_len);

See Also