Mercurial > hg > nginx
comparison src/http/modules/ngx_http_upstream_keepalive_module.c @ 5213:822b82191940
Upstream keepalive: slightly simplified code.
author | Ruslan Ermilov <ru@nginx.com> |
---|---|
date | Wed, 15 May 2013 15:04:49 +0400 |
parents | 089a662c17d1 |
children | 3e5b630e0ec9 |
comparison
equal
deleted
inserted
replaced
5212:09dbd363050a | 5213:822b82191940 |
---|---|
79 static ngx_command_t ngx_http_upstream_keepalive_commands[] = { | 79 static ngx_command_t ngx_http_upstream_keepalive_commands[] = { |
80 | 80 |
81 { ngx_string("keepalive"), | 81 { ngx_string("keepalive"), |
82 NGX_HTTP_UPS_CONF|NGX_CONF_TAKE12, | 82 NGX_HTTP_UPS_CONF|NGX_CONF_TAKE12, |
83 ngx_http_upstream_keepalive, | 83 ngx_http_upstream_keepalive, |
84 0, | 84 NGX_HTTP_SRV_CONF_OFFSET, |
85 0, | 85 0, |
86 NULL }, | 86 NULL }, |
87 | 87 |
88 ngx_null_command | 88 ngx_null_command |
89 }; | 89 }; |
479 | 479 |
480 static char * | 480 static char * |
481 ngx_http_upstream_keepalive(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) | 481 ngx_http_upstream_keepalive(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) |
482 { | 482 { |
483 ngx_http_upstream_srv_conf_t *uscf; | 483 ngx_http_upstream_srv_conf_t *uscf; |
484 ngx_http_upstream_keepalive_srv_conf_t *kcf; | 484 ngx_http_upstream_keepalive_srv_conf_t *kcf = conf; |
485 | 485 |
486 ngx_int_t n; | 486 ngx_int_t n; |
487 ngx_str_t *value; | 487 ngx_str_t *value; |
488 ngx_uint_t i; | 488 ngx_uint_t i; |
489 | 489 |
490 uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module); | 490 uscf = ngx_http_conf_get_module_srv_conf(cf, ngx_http_upstream_module); |
491 | |
492 kcf = ngx_http_conf_upstream_srv_conf(uscf, | |
493 ngx_http_upstream_keepalive_module); | |
494 | 491 |
495 if (kcf->original_init_upstream) { | 492 if (kcf->original_init_upstream) { |
496 return "is duplicate"; | 493 return "is duplicate"; |
497 } | 494 } |
498 | 495 |