1 | =pod
|
---|
2 |
|
---|
3 | =head1 NAME
|
---|
4 |
|
---|
5 | SSL_new_stream, SSL_STREAM_FLAG_UNI, SSL_STREAM_FLAG_NO_BLOCK,
|
---|
6 | SSL_STREAM_FLAG_ADVANCE - create a new locally-initiated QUIC stream
|
---|
7 |
|
---|
8 | =head1 SYNOPSIS
|
---|
9 |
|
---|
10 | #include <openssl/ssl.h>
|
---|
11 |
|
---|
12 | #define SSL_STREAM_FLAG_UNI (1U << 0)
|
---|
13 | #define SSL_STREAM_FLAG_NO_BLOCK (1U << 1)
|
---|
14 | #define SSL_STREAM_FLAG_ADVANCE (1U << 2)
|
---|
15 | SSL *SSL_new_stream(SSL *ssl, uint64_t flags);
|
---|
16 |
|
---|
17 | =head1 DESCRIPTION
|
---|
18 |
|
---|
19 | The SSL_new_stream() function, when passed a QUIC connection SSL object, creates
|
---|
20 | a new locally-initiated bidirectional or unidirectional QUIC stream and returns
|
---|
21 | the newly created QUIC stream SSL object.
|
---|
22 |
|
---|
23 | If the B<SSL_STREAM_FLAG_UNI> flag is passed, a unidirectional stream is
|
---|
24 | created; else a bidirectional stream is created.
|
---|
25 |
|
---|
26 | To retrieve the stream ID of the newly created stream, use
|
---|
27 | L<SSL_get_stream_id(3)>.
|
---|
28 |
|
---|
29 | It is the caller's responsibility to free the QUIC stream SSL object using
|
---|
30 | L<SSL_free(3)>. The lifetime of the QUIC connection SSL object must exceed that
|
---|
31 | of the QUIC stream SSL object; in other words, the QUIC stream SSL object must
|
---|
32 | be freed first.
|
---|
33 |
|
---|
34 | Once a stream has been created using SSL_new_stream(), it may be used in the
|
---|
35 | normal way using L<SSL_read(3)> and L<SSL_write(3)>.
|
---|
36 |
|
---|
37 | This function can only be used to create stream objects for locally-initiated
|
---|
38 | streams. To accept incoming streams initiated by a peer, use
|
---|
39 | L<SSL_accept_stream(3)>.
|
---|
40 |
|
---|
41 | Calling SSL_new_stream() if there is no default stream already present
|
---|
42 | inhibits the future creation of a default stream. See L<openssl-quic(7)>.
|
---|
43 |
|
---|
44 | The creation of new streams is subject to flow control by the QUIC protocol. If
|
---|
45 | it is currently not possible to create a new locally initiated stream of the
|
---|
46 | specified type, a call to SSL_new_stream() will either block (if the connection
|
---|
47 | is configured in blocking mode) until a new stream can be created, or otherwise
|
---|
48 | return NULL.
|
---|
49 |
|
---|
50 | This function operates in blocking mode if the QUIC connection SSL object is
|
---|
51 | configured in blocking mode (see L<SSL_set_blocking_mode(3)>). It may also be
|
---|
52 | used in nonblocking mode on a connection configured in blocking mode by passing
|
---|
53 | the flag B<SSL_STREAM_FLAG_NO_BLOCK>.
|
---|
54 |
|
---|
55 | The flag B<SSL_STREAM_FLAG_ADVANCE> may be used to create a QUIC stream SSL
|
---|
56 | object even if a new QUIC stream cannot yet be opened due to flow control. The
|
---|
57 | caller may begin to use the new stream and fill the write buffer of the stream
|
---|
58 | by calling L<SSL_write(3)>. However, no actual stream data (or QUIC frames
|
---|
59 | regarding the stream) will be sent until QUIC flow control allows it. Any queued
|
---|
60 | data will be sent as soon as a peer permits it. There is no guarantee the stream
|
---|
61 | will be eventually created; for example, the connection could fail, or a peer
|
---|
62 | might simply decide never to increase the number of allowed streams for the
|
---|
63 | remainder of the connection lifetime.
|
---|
64 |
|
---|
65 | =head1 RETURN VALUES
|
---|
66 |
|
---|
67 | SSL_new_stream() returns a new stream object, or NULL on error.
|
---|
68 |
|
---|
69 | This function fails if called on a QUIC stream SSL object or on a non-QUIC SSL
|
---|
70 | object.
|
---|
71 |
|
---|
72 | =head1 SEE ALSO
|
---|
73 |
|
---|
74 | L<SSL_accept_stream(3)>, L<SSL_free(3)>
|
---|
75 |
|
---|
76 | =head1 HISTORY
|
---|
77 |
|
---|
78 | SSL_new_stream() was added in OpenSSL 3.2.
|
---|
79 |
|
---|
80 | =head1 COPYRIGHT
|
---|
81 |
|
---|
82 | Copyright 2002-2023 The OpenSSL Project Authors. All Rights Reserved.
|
---|
83 |
|
---|
84 | Licensed under the Apache License 2.0 (the "License"). You may not use
|
---|
85 | this file except in compliance with the License. You can obtain a copy
|
---|
86 | in the file LICENSE in the source distribution or at
|
---|
87 | L<https://www.openssl.org/source/license.html>.
|
---|
88 |
|
---|
89 | =cut
|
---|