<feed xmlns='http://www.w3.org/2005/Atom'>
<title>nginx.git/src/http/v3/ngx_http_v3_uni.c, branch release-1.30.0</title>
<subtitle>nginx</subtitle>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/'/>
<entry>
<title>HTTP/3: decoder stream pre-creation.</title>
<updated>2024-05-28T13:18:28+00:00</updated>
<author>
<name>Roman Arutyunyan</name>
<email>arut@nginx.com</email>
</author>
<published>2024-05-28T13:18:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=0fd59c8b565c4577f7c25b9e6450bd311d18f5e2'/>
<id>0fd59c8b565c4577f7c25b9e6450bd311d18f5e2</id>
<content type='text'>
Previously a decoder stream was created on demand for sending Section
Acknowledgement, Stream Cancellation and Insert Count Increment.  If conditions
for sending any of these instructions never happen, a decoder stream is not
created at all.  These conditions include client not using the dynamic table and
no streams abandoned by server (RFC 9204, Section 2.2.2.2).  However RFC 9204,
Section 4.2 defines only one condition for not creating a decoder stream:

   An endpoint MAY avoid creating a decoder stream if its decoder sets
   the maximum capacity of the dynamic table to zero.

The change enables pre-creation of the decoder stream at HTTP/3 session
initialization if maximum dynamic table capacity is not zero.  Note that this
value is currently hardcoded to 4096 bytes and is not configurable, so the
stream is now always created.

Also, the change fixes a potential stack overflow when creating a decoder
stream in ngx_http_v3_send_cancel_stream() while draining a request stream by
ngx_drain_connections().  Creating a decoder stream involves calling
ngx_get_connection(), which calls ngx_drain_connections(), which will drain the
same request stream again.  If client's MAX_STREAMS for uni stream is high
enough, these recursive calls will continue until we run out of stack.
Otherwise, decoder stream creation will fail at some point and the request
stream connection will be drained.  This may result in use-after-free, since
this connection could still be referenced up the stack.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously a decoder stream was created on demand for sending Section
Acknowledgement, Stream Cancellation and Insert Count Increment.  If conditions
for sending any of these instructions never happen, a decoder stream is not
created at all.  These conditions include client not using the dynamic table and
no streams abandoned by server (RFC 9204, Section 2.2.2.2).  However RFC 9204,
Section 4.2 defines only one condition for not creating a decoder stream:

   An endpoint MAY avoid creating a decoder stream if its decoder sets
   the maximum capacity of the dynamic table to zero.

The change enables pre-creation of the decoder stream at HTTP/3 session
initialization if maximum dynamic table capacity is not zero.  Note that this
value is currently hardcoded to 4096 bytes and is not configurable, so the
stream is now always created.

Also, the change fixes a potential stack overflow when creating a decoder
stream in ngx_http_v3_send_cancel_stream() while draining a request stream by
ngx_drain_connections().  Creating a decoder stream involves calling
ngx_get_connection(), which calls ngx_drain_connections(), which will drain the
same request stream again.  If client's MAX_STREAMS for uni stream is high
enough, these recursive calls will continue until we run out of stack.
Otherwise, decoder stream creation will fail at some point and the request
stream connection will be drained.  This may result in use-after-free, since
this connection could still be referenced up the stack.
</pre>
</div>
</content>
</entry>
<entry>
<title>HTTP/3: removed server push support.</title>
<updated>2023-05-12T06:02:10+00:00</updated>
<author>
<name>Roman Arutyunyan</name>
<email>arut@nginx.com</email>
</author>
<published>2023-05-12T06:02:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=e4edf78bac950213e00bb97ac46ece807f3cc073'/>
<id>e4edf78bac950213e00bb97ac46ece807f3cc073</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>HTTP/3: fixed CANCEL_PUSH handling.</title>
<updated>2023-04-06T14:18:41+00:00</updated>
<author>
<name>Sergey Kandaurov</name>
<email>pluknet@nginx.com</email>
</author>
<published>2023-04-06T14:18:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=ba15b2af1bc130725a1069c5c263779db350e9b0'/>
<id>ba15b2af1bc130725a1069c5c263779db350e9b0</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>HTTP/3: "quic" parameter of "listen" directive.</title>
<updated>2023-02-27T10:00:56+00:00</updated>
<author>
<name>Roman Arutyunyan</name>
<email>arut@nginx.com</email>
</author>
<published>2023-02-27T10:00:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=815ef96124176baef4e940c4beaec158305b368a'/>
<id>815ef96124176baef4e940c4beaec158305b368a</id>
<content type='text'>
Now "listen" directve has a new "quic" parameter which enables QUIC protocol
for the address.  Further, to enable HTTP/3, a new directive "http3" is
introduced.  The hq-interop protocol is enabled by "http3_hq" as before.
Now application protocol is chosen by ALPN.

Previously used "http3" parameter of "listen" is deprecated.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now "listen" directve has a new "quic" parameter which enables QUIC protocol
for the address.  Further, to enable HTTP/3, a new directive "http3" is
introduced.  The hq-interop protocol is enabled by "http3_hq" as before.
Now application protocol is chosen by ALPN.

Previously used "http3" parameter of "listen" is deprecated.
</pre>
</div>
</content>
</entry>
<entry>
<title>HTTP/3: unified hq code with regular HTTP/3 code.</title>
<updated>2022-10-19T13:45:30+00:00</updated>
<author>
<name>Roman Arutyunyan</name>
<email>arut@nginx.com</email>
</author>
<published>2022-10-19T13:45:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=dd4c31fc34bd8390dd3fa9e804afc15b57b69135'/>
<id>dd4c31fc34bd8390dd3fa9e804afc15b57b69135</id>
<content type='text'>
The change removes hq-specific request handler.  Now hq requests are handled
by the HTTP/3 request handler.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The change removes hq-specific request handler.  Now hq requests are handled
by the HTTP/3 request handler.
</pre>
</div>
</content>
</entry>
<entry>
<title>QUIC: reusable mode for main connection.</title>
<updated>2022-11-29T13:46:46+00:00</updated>
<author>
<name>Roman Arutyunyan</name>
<email>arut@nginx.com</email>
</author>
<published>2022-11-29T13:46:46+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=dc82bed893cc4292c459d41269882b621b98f5b3'/>
<id>dc82bed893cc4292c459d41269882b621b98f5b3</id>
<content type='text'>
The connection is automatically switched to this mode by transport layer when
there are no non-cancelable streams.  Currently, cancelable streams are
HTTP/3 encoder/decoder/control streams.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The connection is automatically switched to this mode by transport layer when
there are no non-cancelable streams.  Currently, cancelable streams are
HTTP/3 encoder/decoder/control streams.
</pre>
</div>
</content>
</entry>
<entry>
<title>QUIC: stream lingering.</title>
<updated>2022-02-05T09:54:54+00:00</updated>
<author>
<name>Roman Arutyunyan</name>
<email>arut@nginx.com</email>
</author>
<published>2022-02-05T09:54:54+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=7c4b4f4d540de7959311ab0f6bfafac5ab46f67b'/>
<id>7c4b4f4d540de7959311ab0f6bfafac5ab46f67b</id>
<content type='text'>
Now ngx_quic_stream_t is decoupled from ngx_connection_t in a way that it
can persist after connection is closed by application.  During this period,
server is expecting stream final size from client for correct flow control.
Also, buffered output is sent to client as more flow control credit is granted.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Now ngx_quic_stream_t is decoupled from ngx_connection_t in a way that it
can persist after connection is closed by application.  During this period,
server is expecting stream final size from client for correct flow control.
Also, buffered output is sent to client as more flow control credit is granted.
</pre>
</div>
</content>
</entry>
<entry>
<title>HTTP/3: proper uni stream closure detection.</title>
<updated>2022-01-31T06:46:30+00:00</updated>
<author>
<name>Roman Arutyunyan</name>
<email>arut@nginx.com</email>
</author>
<published>2022-01-31T06:46:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=77efe512fa18580bef6f8d795bc1c1cfff5d0097'/>
<id>77efe512fa18580bef6f8d795bc1c1cfff5d0097</id>
<content type='text'>
Previously, closure detection for server-initiated uni streams was not properly
implemented.  Instead, HTTP/3 code relied on QUIC code posting the read event
and setting rev-&gt;error when it needed to close the stream.  Then, regular
uni stream read handler called c-&gt;recv() and received error, which closed the
stream.  This was an ad-hoc solution.  If, for whatever reason, the read
handler was called earlier, c-&gt;recv() would return 0, which would also close
the stream.

Now server-initiated uni streams have a separate read event handler for
tracking stream closure.  The handler calls c-&gt;recv(), which normally returns
0, but may return error in case of closure.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, closure detection for server-initiated uni streams was not properly
implemented.  Instead, HTTP/3 code relied on QUIC code posting the read event
and setting rev-&gt;error when it needed to close the stream.  Then, regular
uni stream read handler called c-&gt;recv() and received error, which closed the
stream.  This was an ad-hoc solution.  If, for whatever reason, the read
handler was called earlier, c-&gt;recv() would return 0, which would also close
the stream.

Now server-initiated uni streams have a separate read event handler for
tracking stream closure.  The handler calls c-&gt;recv(), which normally returns
0, but may return error in case of closure.
</pre>
</div>
</content>
</entry>
<entry>
<title>HTTP/3: renamed files.</title>
<updated>2021-12-07T10:01:28+00:00</updated>
<author>
<name>Roman Arutyunyan</name>
<email>arut@nginx.com</email>
</author>
<published>2021-12-07T10:01:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.sigsegv.uk/nginx.git/commit/?id=d1bc1da950488d8d3114a06ca00346fa58848a2d'/>
<id>d1bc1da950488d8d3114a06ca00346fa58848a2d</id>
<content type='text'>
ngx_http_v3_tables.h and ngx_http_v3_tables.c are renamed to
ngx_http_v3_table.h and ngx_http_v3_table.c to better match HTTP/2 code.

ngx_http_v3_streams.h and ngx_http_v3_streams.c are renamed to
ngx_http_v3_uni.h and ngx_http_v3_uni.c to better match their content.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ngx_http_v3_tables.h and ngx_http_v3_tables.c are renamed to
ngx_http_v3_table.h and ngx_http_v3_table.c to better match HTTP/2 code.

ngx_http_v3_streams.h and ngx_http_v3_streams.c are renamed to
ngx_http_v3_uni.h and ngx_http_v3_uni.c to better match their content.
</pre>
</div>
</content>
</entry>
</feed>
