diff options
| author | Maxim Dounin <mdounin@mdounin.ru> | 2012-07-02 16:41:13 +0000 |
|---|---|---|
| committer | Maxim Dounin <mdounin@mdounin.ru> | 2012-07-02 16:41:13 +0000 |
| commit | eaf3544e15cc7551efa128ed5bb67851cb57d11e (patch) | |
| tree | e20e507b071e05890536f6d91319ffcaa0858ffa /src/http/modules/ngx_http_upstream_keepalive_module.c | |
| parent | bb612f1336ec34f6f73f5b4b0b8cb3d9fb99e53f (diff) | |
| download | nginx-eaf3544e15cc7551efa128ed5bb67851cb57d11e.tar.gz nginx-eaf3544e15cc7551efa128ed5bb67851cb57d11e.tar.bz2 | |
Merge of r4655, r4656, r4657, r4695, r4696: upstream changes.
*) Upstream: least_conn balancer module.
*) Upstream: weights and IPv6 support in ip_hash balancer.
*) Upstream keepalive: "single" parameter deprecated.
Diffstat (limited to 'src/http/modules/ngx_http_upstream_keepalive_module.c')
| -rw-r--r-- | src/http/modules/ngx_http_upstream_keepalive_module.c | 33 |
1 files changed, 4 insertions, 29 deletions
diff --git a/src/http/modules/ngx_http_upstream_keepalive_module.c b/src/http/modules/ngx_http_upstream_keepalive_module.c index 6fd9ac70a..d10e3d016 100644 --- a/src/http/modules/ngx_http_upstream_keepalive_module.c +++ b/src/http/modules/ngx_http_upstream_keepalive_module.c @@ -12,7 +12,6 @@ typedef struct { ngx_uint_t max_cached; - ngx_uint_t single; /* unsigned:1 */ ngx_queue_t cache; ngx_queue_t free; @@ -223,36 +222,11 @@ ngx_http_upstream_get_keepalive_peer(ngx_peer_connection_t *pc, void *data) kp->failed = 0; - /* single pool of cached connections */ - - if (kp->conf->single && !ngx_queue_empty(&kp->conf->cache)) { - - q = ngx_queue_head(&kp->conf->cache); - - item = ngx_queue_data(q, ngx_http_upstream_keepalive_cache_t, queue); - c = item->connection; - - ngx_queue_remove(q); - ngx_queue_insert_head(&kp->conf->free, q); - - ngx_log_debug1(NGX_LOG_DEBUG_HTTP, pc->log, 0, - "get keepalive peer: using connection %p", c); - - c->idle = 0; - c->log = pc->log; - c->read->log = pc->log; - c->write->log = pc->log; - c->pool->log = pc->log; - - pc->connection = c; - pc->cached = 1; - - return NGX_DONE; - } + /* ask balancer */ rc = kp->original_get_peer(pc, kp->data); - if (kp->conf->single || rc != NGX_OK) { + if (rc != NGX_OK) { return rc; } @@ -552,7 +526,8 @@ ngx_http_upstream_keepalive(ngx_conf_t *cf, ngx_command_t *cmd, void *conf) for (i = 2; i < cf->args->nelts; i++) { if (ngx_strcmp(value[i].data, "single") == 0) { - kcf->single = 1; + ngx_conf_log_error(NGX_LOG_WARN, cf, 0, + "the \"single\" parameter is deprecated"); continue; } |
