Back to home page

Nginx displayed by LXR

Source navigation ]
Diff markup ]
Identifier search ]
general search ]
 
 
Version: nginx-1.13.12 ]​[ nginx-1.12.2 ]​

0001 
0002 /*
0003  * Copyright (C) Nginx, Inc.
0004  * Copyright (C) Valentin V. Bartenev
0005  */
0006 
0007 
0008 #include <ngx_config.h>
0009 #include <ngx_core.h>
0010 #include <ngx_http.h>
0011 #include <ngx_http_v2_module.h>
0012 
0013 
0014 static ngx_int_t ngx_http_v2_add_variables(ngx_conf_t *cf);
0015 
0016 static ngx_int_t ngx_http_v2_variable(ngx_http_request_t *r,
0017     ngx_http_variable_value_t *v, uintptr_t data);
0018 
0019 static ngx_int_t ngx_http_v2_module_init(ngx_cycle_t *cycle);
0020 
0021 static void *ngx_http_v2_create_main_conf(ngx_conf_t *cf);
0022 static char *ngx_http_v2_init_main_conf(ngx_conf_t *cf, void *conf);
0023 static void *ngx_http_v2_create_srv_conf(ngx_conf_t *cf);
0024 static char *ngx_http_v2_merge_srv_conf(ngx_conf_t *cf, void *parent,
0025     void *child);
0026 static void *ngx_http_v2_create_loc_conf(ngx_conf_t *cf);
0027 static char *ngx_http_v2_merge_loc_conf(ngx_conf_t *cf, void *parent,
0028     void *child);
0029 
0030 static char *ngx_http_v2_push(ngx_conf_t *cf, ngx_command_t *cmd, void *conf);
0031 
0032 static char *ngx_http_v2_recv_buffer_size(ngx_conf_t *cf, void *post,
0033     void *data);
0034 static char *ngx_http_v2_pool_size(ngx_conf_t *cf, void *post, void *data);
0035 static char *ngx_http_v2_preread_size(ngx_conf_t *cf, void *post, void *data);
0036 static char *ngx_http_v2_streams_index_mask(ngx_conf_t *cf, void *post,
0037     void *data);
0038 static char *ngx_http_v2_chunk_size(ngx_conf_t *cf, void *post, void *data);
0039 static char *ngx_http_v2_spdy_deprecated(ngx_conf_t *cf, ngx_command_t *cmd,
0040     void *conf);
0041 
0042 
0043 static ngx_conf_post_t  ngx_http_v2_recv_buffer_size_post =
0044     { ngx_http_v2_recv_buffer_size };
0045 static ngx_conf_post_t  ngx_http_v2_pool_size_post =
0046     { ngx_http_v2_pool_size };
0047 static ngx_conf_post_t  ngx_http_v2_preread_size_post =
0048     { ngx_http_v2_preread_size };
0049 static ngx_conf_post_t  ngx_http_v2_streams_index_mask_post =
0050     { ngx_http_v2_streams_index_mask };
0051 static ngx_conf_post_t  ngx_http_v2_chunk_size_post =
0052     { ngx_http_v2_chunk_size };
0053 
0054 
0055 static ngx_command_t  ngx_http_v2_commands[] = {
0056 
0057     { ngx_string("http2_recv_buffer_size"),
0058       NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
0059       ngx_conf_set_size_slot,
0060       NGX_HTTP_MAIN_CONF_OFFSET,
0061       offsetof(ngx_http_v2_main_conf_t, recv_buffer_size),
0062       &ngx_http_v2_recv_buffer_size_post },
0063 
0064     { ngx_string("http2_pool_size"),
0065       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
0066       ngx_conf_set_size_slot,
0067       NGX_HTTP_SRV_CONF_OFFSET,
0068       offsetof(ngx_http_v2_srv_conf_t, pool_size),
0069       &ngx_http_v2_pool_size_post },
0070 
0071     { ngx_string("http2_max_concurrent_streams"),
0072       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
0073       ngx_conf_set_num_slot,
0074       NGX_HTTP_SRV_CONF_OFFSET,
0075       offsetof(ngx_http_v2_srv_conf_t, concurrent_streams),
0076       NULL },
0077 
0078     { ngx_string("http2_max_concurrent_pushes"),
0079       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
0080       ngx_conf_set_num_slot,
0081       NGX_HTTP_SRV_CONF_OFFSET,
0082       offsetof(ngx_http_v2_srv_conf_t, concurrent_pushes),
0083       NULL },
0084 
0085     { ngx_string("http2_max_requests"),
0086       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
0087       ngx_conf_set_num_slot,
0088       NGX_HTTP_SRV_CONF_OFFSET,
0089       offsetof(ngx_http_v2_srv_conf_t, max_requests),
0090       NULL },
0091 
0092     { ngx_string("http2_max_field_size"),
0093       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
0094       ngx_conf_set_size_slot,
0095       NGX_HTTP_SRV_CONF_OFFSET,
0096       offsetof(ngx_http_v2_srv_conf_t, max_field_size),
0097       NULL },
0098 
0099     { ngx_string("http2_max_header_size"),
0100       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
0101       ngx_conf_set_size_slot,
0102       NGX_HTTP_SRV_CONF_OFFSET,
0103       offsetof(ngx_http_v2_srv_conf_t, max_header_size),
0104       NULL },
0105 
0106     { ngx_string("http2_body_preread_size"),
0107       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
0108       ngx_conf_set_size_slot,
0109       NGX_HTTP_SRV_CONF_OFFSET,
0110       offsetof(ngx_http_v2_srv_conf_t, preread_size),
0111       &ngx_http_v2_preread_size_post },
0112 
0113     { ngx_string("http2_streams_index_size"),
0114       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
0115       ngx_conf_set_num_slot,
0116       NGX_HTTP_SRV_CONF_OFFSET,
0117       offsetof(ngx_http_v2_srv_conf_t, streams_index_mask),
0118       &ngx_http_v2_streams_index_mask_post },
0119 
0120     { ngx_string("http2_recv_timeout"),
0121       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
0122       ngx_conf_set_msec_slot,
0123       NGX_HTTP_SRV_CONF_OFFSET,
0124       offsetof(ngx_http_v2_srv_conf_t, recv_timeout),
0125       NULL },
0126 
0127     { ngx_string("http2_idle_timeout"),
0128       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
0129       ngx_conf_set_msec_slot,
0130       NGX_HTTP_SRV_CONF_OFFSET,
0131       offsetof(ngx_http_v2_srv_conf_t, idle_timeout),
0132       NULL },
0133 
0134     { ngx_string("http2_chunk_size"),
0135       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
0136       ngx_conf_set_size_slot,
0137       NGX_HTTP_LOC_CONF_OFFSET,
0138       offsetof(ngx_http_v2_loc_conf_t, chunk_size),
0139       &ngx_http_v2_chunk_size_post },
0140 
0141     { ngx_string("http2_push_preload"),
0142       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_FLAG,
0143       ngx_conf_set_flag_slot,
0144       NGX_HTTP_LOC_CONF_OFFSET,
0145       offsetof(ngx_http_v2_loc_conf_t, push_preload),
0146       NULL },
0147 
0148     { ngx_string("http2_push"),
0149       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
0150       ngx_http_v2_push,
0151       NGX_HTTP_LOC_CONF_OFFSET,
0152       0,
0153       NULL },
0154 
0155     { ngx_string("spdy_recv_buffer_size"),
0156       NGX_HTTP_MAIN_CONF|NGX_CONF_TAKE1,
0157       ngx_http_v2_spdy_deprecated,
0158       NGX_HTTP_MAIN_CONF_OFFSET,
0159       0,
0160       NULL },
0161 
0162     { ngx_string("spdy_pool_size"),
0163       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
0164       ngx_http_v2_spdy_deprecated,
0165       NGX_HTTP_SRV_CONF_OFFSET,
0166       0,
0167       NULL },
0168 
0169     { ngx_string("spdy_max_concurrent_streams"),
0170       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
0171       ngx_http_v2_spdy_deprecated,
0172       NGX_HTTP_SRV_CONF_OFFSET,
0173       0,
0174       NULL },
0175 
0176     { ngx_string("spdy_streams_index_size"),
0177       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
0178       ngx_http_v2_spdy_deprecated,
0179       NGX_HTTP_SRV_CONF_OFFSET,
0180       0,
0181       NULL },
0182 
0183     { ngx_string("spdy_recv_timeout"),
0184       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
0185       ngx_http_v2_spdy_deprecated,
0186       NGX_HTTP_SRV_CONF_OFFSET,
0187       0,
0188       NULL },
0189 
0190     { ngx_string("spdy_keepalive_timeout"),
0191       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
0192       ngx_http_v2_spdy_deprecated,
0193       NGX_HTTP_SRV_CONF_OFFSET,
0194       0,
0195       NULL },
0196 
0197     { ngx_string("spdy_headers_comp"),
0198       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_CONF_TAKE1,
0199       ngx_http_v2_spdy_deprecated,
0200       NGX_HTTP_SRV_CONF_OFFSET,
0201       0,
0202       NULL },
0203 
0204     { ngx_string("spdy_chunk_size"),
0205       NGX_HTTP_MAIN_CONF|NGX_HTTP_SRV_CONF|NGX_HTTP_LOC_CONF|NGX_CONF_TAKE1,
0206       ngx_http_v2_spdy_deprecated,
0207       NGX_HTTP_LOC_CONF_OFFSET,
0208       0,
0209       NULL },
0210 
0211       ngx_null_command
0212 };
0213 
0214 
0215 static ngx_http_module_t  ngx_http_v2_module_ctx = {
0216     ngx_http_v2_add_variables,             /* preconfiguration */
0217     NULL,                                  /* postconfiguration */
0218 
0219     ngx_http_v2_create_main_conf,          /* create main configuration */
0220     ngx_http_v2_init_main_conf,            /* init main configuration */
0221 
0222     ngx_http_v2_create_srv_conf,           /* create server configuration */
0223     ngx_http_v2_merge_srv_conf,            /* merge server configuration */
0224 
0225     ngx_http_v2_create_loc_conf,           /* create location configuration */
0226     ngx_http_v2_merge_loc_conf             /* merge location configuration */
0227 };
0228 
0229 
0230 ngx_module_t  ngx_http_v2_module = {
0231     NGX_MODULE_V1,
0232     &ngx_http_v2_module_ctx,               /* module context */
0233     ngx_http_v2_commands,                  /* module directives */
0234     NGX_HTTP_MODULE,                       /* module type */
0235     NULL,                                  /* init master */
0236     ngx_http_v2_module_init,               /* init module */
0237     NULL,                                  /* init process */
0238     NULL,                                  /* init thread */
0239     NULL,                                  /* exit thread */
0240     NULL,                                  /* exit process */
0241     NULL,                                  /* exit master */
0242     NGX_MODULE_V1_PADDING
0243 };
0244 
0245 
0246 static ngx_http_variable_t  ngx_http_v2_vars[] = {
0247 
0248     { ngx_string("http2"), NULL,
0249       ngx_http_v2_variable, 0, 0, 0 },
0250 
0251       ngx_http_null_variable
0252 };
0253 
0254 
0255 static ngx_int_t
0256 ngx_http_v2_add_variables(ngx_conf_t *cf)
0257 {
0258     ngx_http_variable_t  *var, *v;
0259 
0260     for (v = ngx_http_v2_vars; v->name.len; v++) {
0261         var = ngx_http_add_variable(cf, &v->name, v->flags);
0262         if (var == NULL) {
0263             return NGX_ERROR;
0264         }
0265 
0266         var->get_handler = v->get_handler;
0267         var->data = v->data;
0268     }
0269 
0270     return NGX_OK;
0271 }
0272 
0273 
0274 static ngx_int_t
0275 ngx_http_v2_variable(ngx_http_request_t *r,
0276     ngx_http_variable_value_t *v, uintptr_t data)
0277 {
0278 
0279     if (r->stream) {
0280 #if (NGX_HTTP_SSL)
0281 
0282         if (r->connection->ssl) {
0283             v->len = sizeof("h2") - 1;
0284             v->valid = 1;
0285             v->no_cacheable = 0;
0286             v->not_found = 0;
0287             v->data = (u_char *) "h2";
0288 
0289             return NGX_OK;
0290         }
0291 
0292 #endif
0293         v->len = sizeof("h2c") - 1;
0294         v->valid = 1;
0295         v->no_cacheable = 0;
0296         v->not_found = 0;
0297         v->data = (u_char *) "h2c";
0298 
0299         return NGX_OK;
0300     }
0301 
0302     *v = ngx_http_variable_null_value;
0303 
0304     return NGX_OK;
0305 }
0306 
0307 
0308 static ngx_int_t
0309 ngx_http_v2_module_init(ngx_cycle_t *cycle)
0310 {
0311     return NGX_OK;
0312 }
0313 
0314 
0315 static void *
0316 ngx_http_v2_create_main_conf(ngx_conf_t *cf)
0317 {
0318     ngx_http_v2_main_conf_t  *h2mcf;
0319 
0320     h2mcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_v2_main_conf_t));
0321     if (h2mcf == NULL) {
0322         return NULL;
0323     }
0324 
0325     h2mcf->recv_buffer_size = NGX_CONF_UNSET_SIZE;
0326 
0327     return h2mcf;
0328 }
0329 
0330 
0331 static char *
0332 ngx_http_v2_init_main_conf(ngx_conf_t *cf, void *conf)
0333 {
0334     ngx_http_v2_main_conf_t *h2mcf = conf;
0335 
0336     ngx_conf_init_size_value(h2mcf->recv_buffer_size, 256 * 1024);
0337 
0338     return NGX_CONF_OK;
0339 }
0340 
0341 
0342 static void *
0343 ngx_http_v2_create_srv_conf(ngx_conf_t *cf)
0344 {
0345     ngx_http_v2_srv_conf_t  *h2scf;
0346 
0347     h2scf = ngx_pcalloc(cf->pool, sizeof(ngx_http_v2_srv_conf_t));
0348     if (h2scf == NULL) {
0349         return NULL;
0350     }
0351 
0352     h2scf->pool_size = NGX_CONF_UNSET_SIZE;
0353 
0354     h2scf->concurrent_streams = NGX_CONF_UNSET_UINT;
0355     h2scf->concurrent_pushes = NGX_CONF_UNSET_UINT;
0356     h2scf->max_requests = NGX_CONF_UNSET_UINT;
0357 
0358     h2scf->max_field_size = NGX_CONF_UNSET_SIZE;
0359     h2scf->max_header_size = NGX_CONF_UNSET_SIZE;
0360 
0361     h2scf->preread_size = NGX_CONF_UNSET_SIZE;
0362 
0363     h2scf->streams_index_mask = NGX_CONF_UNSET_UINT;
0364 
0365     h2scf->recv_timeout = NGX_CONF_UNSET_MSEC;
0366     h2scf->idle_timeout = NGX_CONF_UNSET_MSEC;
0367 
0368     return h2scf;
0369 }
0370 
0371 
0372 static char *
0373 ngx_http_v2_merge_srv_conf(ngx_conf_t *cf, void *parent, void *child)
0374 {
0375     ngx_http_v2_srv_conf_t *prev = parent;
0376     ngx_http_v2_srv_conf_t *conf = child;
0377 
0378     ngx_conf_merge_size_value(conf->pool_size, prev->pool_size, 4096);
0379 
0380     ngx_conf_merge_uint_value(conf->concurrent_streams,
0381                               prev->concurrent_streams, 128);
0382     ngx_conf_merge_uint_value(conf->concurrent_pushes,
0383                               prev->concurrent_pushes, 10);
0384     ngx_conf_merge_uint_value(conf->max_requests, prev->max_requests, 1000);
0385 
0386     ngx_conf_merge_size_value(conf->max_field_size, prev->max_field_size,
0387                               4096);
0388     ngx_conf_merge_size_value(conf->max_header_size, prev->max_header_size,
0389                               16384);
0390 
0391     ngx_conf_merge_size_value(conf->preread_size, prev->preread_size, 65536);
0392 
0393     ngx_conf_merge_uint_value(conf->streams_index_mask,
0394                               prev->streams_index_mask, 32 - 1);
0395 
0396     ngx_conf_merge_msec_value(conf->recv_timeout,
0397                               prev->recv_timeout, 30000);
0398     ngx_conf_merge_msec_value(conf->idle_timeout,
0399                               prev->idle_timeout, 180000);
0400 
0401     return NGX_CONF_OK;
0402 }
0403 
0404 
0405 static void *
0406 ngx_http_v2_create_loc_conf(ngx_conf_t *cf)
0407 {
0408     ngx_http_v2_loc_conf_t  *h2lcf;
0409 
0410     h2lcf = ngx_pcalloc(cf->pool, sizeof(ngx_http_v2_loc_conf_t));
0411     if (h2lcf == NULL) {
0412         return NULL;
0413     }
0414 
0415     /*
0416      * set by ngx_pcalloc():
0417      *
0418      *     h2lcf->pushes = NULL;
0419      */
0420 
0421     h2lcf->chunk_size = NGX_CONF_UNSET_SIZE;
0422 
0423     h2lcf->push_preload = NGX_CONF_UNSET;
0424     h2lcf->push = NGX_CONF_UNSET;
0425 
0426     return h2lcf;
0427 }
0428 
0429 
0430 static char *
0431 ngx_http_v2_merge_loc_conf(ngx_conf_t *cf, void *parent, void *child)
0432 {
0433     ngx_http_v2_loc_conf_t *prev = parent;
0434     ngx_http_v2_loc_conf_t *conf = child;
0435 
0436     ngx_conf_merge_size_value(conf->chunk_size, prev->chunk_size, 8 * 1024);
0437 
0438     ngx_conf_merge_value(conf->push, prev->push, 1);
0439 
0440     if (conf->push && conf->pushes == NULL) {
0441         conf->pushes = prev->pushes;
0442     }
0443 
0444     ngx_conf_merge_value(conf->push_preload, prev->push_preload, 0);
0445 
0446     return NGX_CONF_OK;
0447 }
0448 
0449 
0450 static char *
0451 ngx_http_v2_push(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
0452 {
0453     ngx_http_v2_loc_conf_t *h2lcf = conf;
0454 
0455     ngx_str_t                         *value;
0456     ngx_http_complex_value_t          *cv;
0457     ngx_http_compile_complex_value_t   ccv;
0458 
0459     value = cf->args->elts;
0460 
0461     if (ngx_strcmp(value[1].data, "off") == 0) {
0462 
0463         if (h2lcf->pushes) {
0464             return "\"off\" parameter cannot be used with URI";
0465         }
0466 
0467         if (h2lcf->push == 0) {
0468             return "is duplicate";
0469         }
0470 
0471         h2lcf->push = 0;
0472         return NGX_CONF_OK;
0473     }
0474 
0475     if (h2lcf->push == 0) {
0476         return "URI cannot be used with \"off\" parameter";
0477     }
0478 
0479     h2lcf->push = 1;
0480 
0481     if (h2lcf->pushes == NULL) {
0482         h2lcf->pushes = ngx_array_create(cf->pool, 1,
0483                                          sizeof(ngx_http_complex_value_t));
0484         if (h2lcf->pushes == NULL) {
0485             return NGX_CONF_ERROR;
0486         }
0487     }
0488 
0489     cv = ngx_array_push(h2lcf->pushes);
0490     if (cv == NULL) {
0491         return NGX_CONF_ERROR;
0492     }
0493 
0494     ngx_memzero(&ccv, sizeof(ngx_http_compile_complex_value_t));
0495 
0496     ccv.cf = cf;
0497     ccv.value = &value[1];
0498     ccv.complex_value = cv;
0499 
0500     if (ngx_http_compile_complex_value(&ccv) != NGX_OK) {
0501         return NGX_CONF_ERROR;
0502     }
0503 
0504     return NGX_CONF_OK;
0505 }
0506 
0507 
0508 static char *
0509 ngx_http_v2_recv_buffer_size(ngx_conf_t *cf, void *post, void *data)
0510 {
0511     size_t *sp = data;
0512 
0513     if (*sp <= 2 * NGX_HTTP_V2_STATE_BUFFER_SIZE) {
0514         return "value is too small";
0515     }
0516 
0517     return NGX_CONF_OK;
0518 }
0519 
0520 
0521 static char *
0522 ngx_http_v2_pool_size(ngx_conf_t *cf, void *post, void *data)
0523 {
0524     size_t *sp = data;
0525 
0526     if (*sp < NGX_MIN_POOL_SIZE) {
0527         ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
0528                            "the pool size must be no less than %uz",
0529                            NGX_MIN_POOL_SIZE);
0530 
0531         return NGX_CONF_ERROR;
0532     }
0533 
0534     if (*sp % NGX_POOL_ALIGNMENT) {
0535         ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
0536                            "the pool size must be a multiple of %uz",
0537                            NGX_POOL_ALIGNMENT);
0538 
0539         return NGX_CONF_ERROR;
0540     }
0541 
0542     return NGX_CONF_OK;
0543 }
0544 
0545 
0546 static char *
0547 ngx_http_v2_preread_size(ngx_conf_t *cf, void *post, void *data)
0548 {
0549     size_t *sp = data;
0550 
0551     if (*sp > NGX_HTTP_V2_MAX_WINDOW) {
0552         ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
0553                            "the maximum body preread buffer size is %uz",
0554                            NGX_HTTP_V2_MAX_WINDOW);
0555 
0556         return NGX_CONF_ERROR;
0557     }
0558 
0559     return NGX_CONF_OK;
0560 }
0561 
0562 
0563 static char *
0564 ngx_http_v2_streams_index_mask(ngx_conf_t *cf, void *post, void *data)
0565 {
0566     ngx_uint_t *np = data;
0567 
0568     ngx_uint_t  mask;
0569 
0570     mask = *np - 1;
0571 
0572     if (*np == 0 || (*np & mask)) {
0573         return "must be a power of two";
0574     }
0575 
0576     *np = mask;
0577 
0578     return NGX_CONF_OK;
0579 }
0580 
0581 
0582 static char *
0583 ngx_http_v2_chunk_size(ngx_conf_t *cf, void *post, void *data)
0584 {
0585     size_t *sp = data;
0586 
0587     if (*sp == 0) {
0588         ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
0589                            "the http2 chunk size cannot be zero");
0590 
0591         return NGX_CONF_ERROR;
0592     }
0593 
0594     if (*sp > NGX_HTTP_V2_MAX_FRAME_SIZE) {
0595         *sp = NGX_HTTP_V2_MAX_FRAME_SIZE;
0596     }
0597 
0598     return NGX_CONF_OK;
0599 }
0600 
0601 
0602 static char *
0603 ngx_http_v2_spdy_deprecated(ngx_conf_t *cf, ngx_command_t *cmd, void *conf)
0604 {
0605     ngx_conf_log_error(NGX_LOG_WARN, cf, 0,
0606                        "invalid directive \"%V\": ngx_http_spdy_module "
0607                        "was superseded by ngx_http_v2_module", &cmd->name);
0608 
0609     return NGX_CONF_OK;
0610 }