SSL_stream_reset.pod 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. =pod
  2. =head1 NAME
  3. SSL_stream_reset - reset a QUIC stream
  4. =head1 SYNOPSIS
  5. #include <openssl/ssl.h>
  6. typedef struct ssl_stream_reset_args_st {
  7. uint64_t quic_error_code;
  8. } SSL_STREAM_RESET_ARGS;
  9. int SSL_stream_reset(SSL *ssl,
  10. const SSL_STREAM_RESET_ARGS *args,
  11. size_t args_len);
  12. =head1 DESCRIPTION
  13. The SSL_stream_reset() function resets the send part of a QUIC stream when
  14. called on a QUIC stream SSL object, or on a QUIC connection SSL object with a
  15. default stream attached.
  16. If I<args> is non-NULL, I<args_len> must be set to C<sizeof(*args)>.
  17. I<quic_error_code> is an application-specified error code, which must be in the
  18. range [0, 2**62-1]. If I<args> is NULL, a value of 0 is used.
  19. Resetting a stream indicates to an application that the sending part of the
  20. stream is terminating abnormally. When a stream is reset, the implementation
  21. does not guarantee that any data already passed to L<SSL_write(3)> will be
  22. received by the peer, and data already passed to L<SSL_write(3)> but not yet
  23. transmitted may or may not be discarded. As such, you should only reset
  24. a stream when the information transmitted on the stream no longer matters, for
  25. example due to an error condition.
  26. This function cannot be called on a unidirectional stream initiated by the peer,
  27. as only the sending side of a stream can initiate a stream reset.
  28. It is also possible to trigger a stream reset by calling L<SSL_free(3)>; see the
  29. documentation for L<SSL_free(3)> for details.
  30. The receiving part of the stream (for bidirectional streams) continues to
  31. function normally.
  32. =head1 NOTES
  33. This function corresponds to the QUIC B<RESET_STREAM> frame.
  34. =head1 RETURN VALUES
  35. Returns 1 on success and 0 on failure.
  36. This function fails if called on a QUIC connection SSL object without a default
  37. stream attached, or on a non-QUIC SSL object.
  38. After the first call to this function succeeds for a given stream,
  39. subsequent calls succeed but are ignored. The application error code
  40. used is that passed to the first successful call to this function.
  41. =head1 SEE ALSO
  42. L<SSL_free(3)>
  43. =head1 HISTORY
  44. SSL_stream_reset() was added in OpenSSL 3.2.
  45. =head1 COPYRIGHT
  46. Copyright 2002-2023 The OpenSSL Project Authors. All Rights Reserved.
  47. Licensed under the Apache License 2.0 (the "License"). You may not use
  48. this file except in compliance with the License. You can obtain a copy
  49. in the file LICENSE in the source distribution or at
  50. L<https://www.openssl.org/source/license.html>.
  51. =cut