Where assign values to rrp->peers->last_cached?

Assignment to the variable rrp->peers->last_cached cannot be found in
anywhere in total nginx-1.3.5 source code, if the variable’s default
is zero, this conditional will never be true:

ngx_http_upstream_get_round_robin_peer(ngx_peer_connection_t *pc, void
ngx_http_upstream_rr_peer_data_t *rrp = data;

if (rrp->peers->last_cached) { ==============>//never be true?

    /* cached connection */

    c = rrp->peers->cached[rrp->peers->last_cached];

    /* ngx_unlock_mutex(ppr->peers->mutex); */

c->read->lock = c->read->own_lock;
c->write->lock = c->write->own_lock;

    pc->connection = c;
    pc->cached = 1;

    return NGX_OK;

i don’t know if i am missing something or not, can anyone help me
this? Thank you in advance.

Posted at Nginx Forum:


On Fri, Aug 31, 2012 at 03:27:13AM -0400, lenky0401 wrote:

if (rrp->peers->last_cached) { ==============>//never be true?
    c->write->lock = c->write->own_lock;

this? Thank you in advance.
This code is lefover from earlier incomplete attempts to implement
cached connections. It’s not currently used.

Maxim D.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs