xref: /freebsd/crypto/openssl/doc/man3/SSL_accept_stream.pod (revision e7be843b4a162e68651d3911f0357ed464915629)
1*e7be843bSPierre Pronchery=pod
2*e7be843bSPierre Pronchery
3*e7be843bSPierre Pronchery=head1 NAME
4*e7be843bSPierre Pronchery
5*e7be843bSPierre ProncherySSL_accept_stream, SSL_get_accept_stream_queue_len, SSL_ACCEPT_STREAM_NO_BLOCK -
6*e7be843bSPierre Proncheryaccept an incoming QUIC stream from a QUIC peer
7*e7be843bSPierre Pronchery
8*e7be843bSPierre Pronchery=head1 SYNOPSIS
9*e7be843bSPierre Pronchery
10*e7be843bSPierre Pronchery #include <openssl/ssl.h>
11*e7be843bSPierre Pronchery
12*e7be843bSPierre Pronchery #define SSL_ACCEPT_STREAM_NO_BLOCK
13*e7be843bSPierre Pronchery
14*e7be843bSPierre Pronchery SSL *SSL_accept_stream(SSL *ssl, uint64_t flags);
15*e7be843bSPierre Pronchery
16*e7be843bSPierre Pronchery size_t SSL_get_accept_stream_queue_len(SSL *ssl);
17*e7be843bSPierre Pronchery
18*e7be843bSPierre Pronchery=head1 DESCRIPTION
19*e7be843bSPierre Pronchery
20*e7be843bSPierre ProncheryThe SSL_accept_stream() function attempts to dequeue an incoming stream from the
21*e7be843bSPierre Proncherygiven QUIC connection SSL object and returns the newly allocated QUIC stream SSL
22*e7be843bSPierre Proncheryobject.
23*e7be843bSPierre Pronchery
24*e7be843bSPierre ProncheryIf the queue of incoming streams is empty, this function returns NULL (in
25*e7be843bSPierre Proncherynonblocking mode) or waits for an incoming stream (in blocking mode). This
26*e7be843bSPierre Proncheryfunction may still return NULL in blocking mode, for example if the underlying
27*e7be843bSPierre Proncheryconnection is terminated.
28*e7be843bSPierre Pronchery
29*e7be843bSPierre ProncheryThe caller is responsible for managing the lifetime of the returned QUIC stream
30*e7be843bSPierre ProncherySSL object; for more information, see L<SSL_free(3)>.
31*e7be843bSPierre Pronchery
32*e7be843bSPierre ProncheryThis function will block if the QUIC connection SSL object is configured in
33*e7be843bSPierre Proncheryblocking mode (see L<SSL_set_blocking_mode(3)>), but this may be bypassed by
34*e7be843bSPierre Proncherypassing the flag B<SSL_ACCEPT_STREAM_NO_BLOCK> in I<flags>. If this flag is set,
35*e7be843bSPierre Proncherythis function never blocks.
36*e7be843bSPierre Pronchery
37*e7be843bSPierre ProncheryCalling SSL_accept_stream() if there is no default stream already present
38*e7be843bSPierre Proncheryinhibits the future creation of a default stream. See L<openssl-quic(7)>.
39*e7be843bSPierre Pronchery
40*e7be843bSPierre ProncherySSL_get_accept_stream_queue_len() returns the number of incoming streams
41*e7be843bSPierre Proncherycurrently waiting in the accept queue.
42*e7be843bSPierre Pronchery
43*e7be843bSPierre ProncheryThese functions can be used from multiple threads for the same QUIC connection.
44*e7be843bSPierre Pronchery
45*e7be843bSPierre ProncheryDepending on whether default stream functionality is being used, it may be
46*e7be843bSPierre Proncherynecessary to explicitly configure the incoming stream policy before streams can
47*e7be843bSPierre Proncherybe accepted; see L<SSL_set_incoming_stream_policy(3)>. See also
48*e7be843bSPierre ProncheryL<openssl-quic(7)/MODES OF OPERATION> for more information on default stream
49*e7be843bSPierre Proncheryfunctionality.
50*e7be843bSPierre Pronchery
51*e7be843bSPierre Pronchery=head1 RETURN VALUES
52*e7be843bSPierre Pronchery
53*e7be843bSPierre ProncherySSL_accept_stream() returns a newly allocated QUIC stream SSL object, or NULL if
54*e7be843bSPierre Proncheryno new incoming streams are available, or if the connection has been terminated,
55*e7be843bSPierre Proncheryor if called on an SSL object other than a QUIC connection SSL object.
56*e7be843bSPierre ProncheryL<SSL_get_error(3)> can be used to obtain further information in this case.
57*e7be843bSPierre Pronchery
58*e7be843bSPierre ProncherySSL_get_accept_stream_queue_len() returns the number of incoming streams
59*e7be843bSPierre Proncherycurrently waiting in the accept queue, or 0 if called on an SSL object other than
60*e7be843bSPierre Proncherya QUIC connection SSL object.
61*e7be843bSPierre Pronchery
62*e7be843bSPierre Pronchery=head1 SEE ALSO
63*e7be843bSPierre Pronchery
64*e7be843bSPierre ProncheryL<openssl-quic(7)/MODES OF OPERATION>, L<SSL_new_stream(3)>,
65*e7be843bSPierre ProncheryL<SSL_set_blocking_mode(3)>, L<SSL_free(3)>
66*e7be843bSPierre Pronchery
67*e7be843bSPierre Pronchery=head1 HISTORY
68*e7be843bSPierre Pronchery
69*e7be843bSPierre ProncherySSL_accept_stream() and SSL_get_accept_stream_queue_len() were added in OpenSSL
70*e7be843bSPierre Pronchery3.2.
71*e7be843bSPierre Pronchery
72*e7be843bSPierre Pronchery=head1 COPYRIGHT
73*e7be843bSPierre Pronchery
74*e7be843bSPierre ProncheryCopyright 2002-2023 The OpenSSL Project Authors. All Rights Reserved.
75*e7be843bSPierre Pronchery
76*e7be843bSPierre ProncheryLicensed under the Apache License 2.0 (the "License").  You may not use
77*e7be843bSPierre Proncherythis file except in compliance with the License.  You can obtain a copy
78*e7be843bSPierre Proncheryin the file LICENSE in the source distribution or at
79*e7be843bSPierre ProncheryL<https://www.openssl.org/source/license.html>.
80*e7be843bSPierre Pronchery
81*e7be843bSPierre Pronchery=cut
82