summaryrefslogtreecommitdiffhomepage
path: root/src/http/v2/ngx_http_v2_module.c
diff options
context:
space:
mode:
authorMaxim Dounin <mdounin@mdounin.ru>2021-02-11 21:52:20 +0300
committerMaxim Dounin <mdounin@mdounin.ru>2021-02-11 21:52:20 +0300
commitd18e066d650bff39f1705d3038804873584007af (patch)
tree2155c69e301f8f305fa2cb24449410830762dbde /src/http/v2/ngx_http_v2_module.c
parente82939206dc80a392ecc685013dc98691d9d2f06 (diff)
downloadnginx-d18e066d650bff39f1705d3038804873584007af.tar.gz
nginx-d18e066d650bff39f1705d3038804873584007af.tar.bz2
HTTP/2: removed http2_recv_timeout.
Instead, the client_header_timeout is now used for HTTP/2 reading. Further, the timeout is changed to be set once till no further data left to read, similarly to how client_header_timeout is used in other places.
Diffstat (limited to 'src/http/v2/ngx_http_v2_module.c')
-rw-r--r--src/http/v2/ngx_http_v2_module.c32
1 files changed, 25 insertions, 7 deletions
diff --git a/src/http/v2/ngx_http_v2_module.c b/src/http/v2/ngx_http_v2_module.c
index 3be6bfac8..fc50edddd 100644
--- a/src/http/v2/ngx_http_v2_module.c
+++ b/src/http/v2/ngx_http_v2_module.c
@@ -36,6 +36,13 @@ static char *ngx_http_v2_preread_size(ngx_conf_t *cf, void *post, void *data);
static char *ngx_http_v2_streams_index_mask(ngx_conf_t *cf, void *post,
void *data);
static char *ngx_http_v2_chunk_size(ngx_conf_t *cf, void *post, void *data);
+static char *ngx_http_v2_obsolete(ngx_conf_t *cf, ngx_command_t *cmd,
+ void *conf);
+
+
+static ngx_conf_deprecated_t ngx_http_v2_recv_timeout_deprecated = {
+ ngx_conf_deprecated, "http2_recv_timeout", "client_header_timeout"
+};
static ngx_conf_post_t ngx_http_v2_recv_buffer_size_post =
@@ -117,10 +124,10 @@ static ngx_command_t ngx_http_v2_commands[] = {
{ ngx_string("http2_recv_timeout"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
- ngx_conf_set_msec_slot,
- NGX_HTTP_SRV_CONF_OFFSET,
- offsetof(ngx_http_v2_srv_conf_t, recv_timeout),
- NULL },
+ ngx_http_v2_obsolete,
+ 0,
+ 0,
+ &ngx_http_v2_recv_timeout_deprecated },
{ ngx_string("http2_idle_timeout"),
NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
@@ -304,7 +311,6 @@ ngx_http_v2_create_srv_conf(ngx_conf_t *cf)
h2scf->streams_index_mask = NGX_CONF_UNSET_UINT;
- h2scf->recv_timeout = NGX_CONF_UNSET_MSEC;
h2scf->idle_timeout = NGX_CONF_UNSET_MSEC;
return h2scf;
@@ -335,8 +341,6 @@ ngx_http_v2_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
ngx_conf_merge_uint_value(conf->streams_index_mask,
prev->streams_index_mask, 32 - 1);
- ngx_conf_merge_msec_value(conf->recv_timeout,
- prev->recv_timeout, 30000);
ngx_conf_merge_msec_value(conf->idle_timeout,
prev->idle_timeout, 180000);
@@ -539,3 +543,17 @@ ngx_http_v2_chunk_size(ngx_conf_t *cf, void *post, void *data)
return NGX_CONF_OK;
}
+
+
+static char *
+ngx_http_v2_obsolete(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
+{
+ ngx_conf_deprecated_t *d = cmd->post;
+
+ ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
+ "the \"%s\" directive is obsolete, "
+ "use the \"%s\" directive instead",
+ d->old_name, d->new_name);
+
+ return NGX_CONF_OK;
+}