comparison src/http/ngx_http_core_module.c @ 3773:a08e8b3832ae

gzip_disable degradation
author Igor Sysoev <igor@sysoev.ru>
date Mon, 04 Oct 2010 15:03:00 +0000
parents d1983670b586
children 5ceb0f624233
comparison
equal deleted inserted replaced
3772:c1e3cb4c669c 3773:a08e8b3832ae
3111 clcf->gzip_http_version = NGX_CONF_UNSET_UINT; 3111 clcf->gzip_http_version = NGX_CONF_UNSET_UINT;
3112 #if (NGX_PCRE) 3112 #if (NGX_PCRE)
3113 clcf->gzip_disable = NGX_CONF_UNSET_PTR; 3113 clcf->gzip_disable = NGX_CONF_UNSET_PTR;
3114 #endif 3114 #endif
3115 clcf->gzip_disable_msie6 = 3; 3115 clcf->gzip_disable_msie6 = 3;
3116 #if (NGX_HTTP_DEGRADATION)
3117 clcf->gzip_disable_degradation = 3;
3118 #endif
3116 #endif 3119 #endif
3117 3120
3118 return clcf; 3121 return clcf;
3119 } 3122 }
3120 3123
3371 if (conf->gzip_disable_msie6 == 3) { 3374 if (conf->gzip_disable_msie6 == 3) {
3372 conf->gzip_disable_msie6 = 3375 conf->gzip_disable_msie6 =
3373 (prev->gzip_disable_msie6 == 3) ? 0 : prev->gzip_disable_msie6; 3376 (prev->gzip_disable_msie6 == 3) ? 0 : prev->gzip_disable_msie6;
3374 } 3377 }
3375 3378
3379 #if (NGX_HTTP_DEGRADATION)
3380
3381 if (conf->gzip_disable_degradation == 3) {
3382 conf->gzip_disable_degradation =
3383 (prev->gzip_disable_degradation == 3) ?
3384 0 : prev->gzip_disable_degradation;
3385 }
3386
3387 #endif
3376 #endif 3388 #endif
3377 3389
3378 return NGX_CONF_OK; 3390 return NGX_CONF_OK;
3379 } 3391 }
3380 3392
4392 if (ngx_strcmp(value[i].data, "msie6") == 0) { 4404 if (ngx_strcmp(value[i].data, "msie6") == 0) {
4393 clcf->gzip_disable_msie6 = 1; 4405 clcf->gzip_disable_msie6 = 1;
4394 continue; 4406 continue;
4395 } 4407 }
4396 4408
4409 #if (NGX_HTTP_DEGRADATION)
4410
4411 if (ngx_strcmp(value[i].data, "degradation") == 0) {
4412 clcf->gzip_disable_degradation = 1;
4413 continue;
4414 }
4415
4416 #endif
4417
4397 re = ngx_array_push(clcf->gzip_disable); 4418 re = ngx_array_push(clcf->gzip_disable);
4398 if (re == NULL) { 4419 if (re == NULL) {
4399 return NGX_CONF_ERROR; 4420 return NGX_CONF_ERROR;
4400 } 4421 }
4401 4422
4412 } 4433 }
4413 4434
4414 return NGX_CONF_OK; 4435 return NGX_CONF_OK;
4415 4436
4416 #else 4437 #else
4417 ngx_str_t *value; 4438 ngx_str_t *value;
4439 ngx_uint_t i;
4418 4440
4419 value = cf->args->elts; 4441 value = cf->args->elts;
4420 4442
4421 if (cf->args->nelts == 2 && ngx_strcmp(value[1].data, "msie6") == 0) { 4443 for (i = 1; i < cf->args->nelts; i++) {
4422 clcf->gzip_disable_msie6 = 1; 4444 if (ngx_strcmp(value[i].data, "msie6") == 0) {
4423 return NGX_CONF_OK; 4445 clcf->gzip_disable_msie6 = 1;
4424 } 4446 continue;
4425 4447 }
4426 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0, 4448
4427 "without PCRE library \"gzip_disable\" supports " 4449 #if (NGX_HTTP_DEGRADATION)
4428 "builtin \"msie6\" mask only"); 4450
4429 4451 if (ngx_strcmp(value[i].data, "degradation") == 0) {
4430 return NGX_CONF_ERROR; 4452 clcf->gzip_disable_degradation = 1;
4453 continue;
4454 }
4455
4456 #endif
4457
4458 ngx_conf_log_error(NGX_LOG_EMERG, cf, 0,
4459 "without PCRE library \"gzip_disable\" supports "
4460 "builtin \"msie6\" and \"degradation\" mask only");
4461
4462 return NGX_CONF_ERROR;
4463 }
4464
4465 return NGX_CONF_OK;
4466
4431 #endif 4467 #endif
4432 } 4468 }
4433 4469
4434 #endif 4470 #endif
4435 4471