View | Details | Raw Unified | Return to bug 44147
Collapse All | Expand All

(-)libapache-mod-jk-1.2.22~/native/common/jk_lb_worker.c (-3 / +3 lines)
Lines 619-625 Link Here
619
static worker_record_t *find_best_byvalue(lb_worker_t *p,
619
static worker_record_t *find_best_byvalue(lb_worker_t *p,
620
                                          jk_logger_t *l)
620
                                          jk_logger_t *l)
621
{
621
{
622
    static unsigned int next_offset = 0;
623
    unsigned int i;
622
    unsigned int i;
624
    unsigned int j;
623
    unsigned int j;
625
    unsigned int offset;
624
    unsigned int offset;
Lines 629-635 Link Here
629
    /* find the least busy worker */
628
    /* find the least busy worker */
630
    worker_record_t *candidate = NULL;
629
    worker_record_t *candidate = NULL;
631
630
632
    offset = next_offset;
631
    offset = p->next_offset;
633
632
634
    /* First try to see if we have available candidate */
633
    /* First try to see if we have available candidate */
635
    for (j = offset; j < p->num_of_workers + offset; j++) {
634
    for (j = offset; j < p->num_of_workers + offset; j++) {
Lines 645-651 Link Here
645
                candidate = &p->lb_workers[i];
644
                candidate = &p->lb_workers[i];
646
                curmin = p->lb_workers[i].s->lb_value;
645
                curmin = p->lb_workers[i].s->lb_value;
647
                d = p->lb_workers[i].s->distance;
646
                d = p->lb_workers[i].s->distance;
648
                next_offset = i + 1;
647
                p->next_offset = i + 1;
649
            }
648
            }
650
        }
649
        }
651
    }
650
    }
Lines 1303-1308 Link Here
1303
                    }
1302
                    }
1304
                }
1303
                }
1305
                p->num_of_workers = num_of_workers;
1304
                p->num_of_workers = num_of_workers;
1305
              p->next_offset = 0;
1306
                update_mult(p, l);
1306
                update_mult(p, l);
1307
                for (i = 0; i < num_of_workers; i++) {
1307
                for (i = 0; i < num_of_workers; i++) {
1308
                    for (j = 0; j < i; j++) {
1308
                    for (j = 0; j < i; j++) {
(-)libapache-mod-jk-1.2.22~/native/common/jk_lb_worker.h (+1 lines)
Lines 132-137 Link Here
132
{
132
{
133
    worker_record_t *lb_workers;
133
    worker_record_t *lb_workers;
134
    unsigned int num_of_workers;
134
    unsigned int num_of_workers;
135
    unsigned int next_offset;
135
    char         name[JK_SHM_STR_SIZ+1];
136
    char         name[JK_SHM_STR_SIZ+1];
136
    int          sticky_session;
137
    int          sticky_session;
137
    int          sticky_session_force;
138
    int          sticky_session_force;

Return to bug 44147