summaryrefslogtreecommitdiffhomepage
path: root/src/http/ngx_http_request.c
diff options
context:
space:
mode:
authorVladimir Homutov <vl@nginx.com>2020-04-23 13:41:08 +0300
committerVladimir Homutov <vl@nginx.com>2020-04-23 13:41:08 +0300
commit26b7056972b52c210d43ff52d018b952cce109a5 (patch)
tree9ff5d3010ebf6d0ae1bb456d12a238cb5d3777f7 /src/http/ngx_http_request.c
parentc8edca31379455d4b2f7b6feae6536c3bd30a4de (diff)
downloadnginx-26b7056972b52c210d43ff52d018b952cce109a5.tar.gz
nginx-26b7056972b52c210d43ff52d018b952cce109a5.tar.bz2
Added proper handling of connection close phases.
There are following flags in quic connection: closing - true, when a connection close is initiated, for whatever reason draining - true, when a CC frame is received from peer The following state machine is used for closing: +------------------+ | I/HS/AD | +------------------+ | | | | | V | | immediate close initiated: | | reasons: close by top-level protocol, fatal error | | + sends CC (probably with app-level message) | | + starts close_timer: 3 * PTO (current probe timeout) | | | | | V | | +---------+ - Reply to input with CC (rate-limited) | | | CLOSING | - Close/Reset all streams | | +---------+ | | | | | V V | | receives CC | | | | idle | | timer | | | V | | +----------+ | - MUST NOT send anything (MAY send a single CC) | | DRAINING | | - if not already started, starts close_timer: 3 * PTO | +----------+ | - if not already done, close all streams | | | | | | | close_timer fires | | V V +------------------------+ | CLOSED | - clean up all the resources, drop connection +------------------------+ state completely The ngx_quic_close_connection() function gets an "rc" argument, that signals reason of connection closing: NGX_OK - initiated by application (i.e. http/3), follow state machine NGX_DONE - timedout (while idle or draining) NGX_ERROR - fatal error, destroy connection immediately The PTO calculations are not yet implemented, hardcoded value of 5s is used.
Diffstat (limited to 'src/http/ngx_http_request.c')
0 files changed, 0 insertions, 0 deletions