pp->pgindex = i + 1;
for (k = 0; k < num_paths_args; k++)
- if (k == 0 && !strncmp(mpp->selector,
- "round-robin", 11)) {
- p += get_word(p, &word);
- def_minio = atoi(word);
+ if (k == 0) {
+ if (!strncmp(mpp->selector,
+ "round-robin", 11)) {
+ p += get_word(p, &word);
+ def_minio = atoi(word);
+
+ if (mpp->rr_weight == RR_WEIGHT_PRIO
+ && pp->priority > 0)
+ def_minio /= pp->priority;
- if (mpp->rr_weight == RR_WEIGHT_PRIO
- && pp->priority > 0)
- def_minio /= pp->priority;
+ FREE(word);
+ } else
+ def_minio = 0;
- FREE(word);
if (def_minio != mpp->minio)
mpp->minio = def_minio;
}
int num_pg;
int num_pg_args;
int num_paths;
+ int def_minio = 0;
struct path * pp;
struct pathgroup * pgp;
FREE(word);
/*
- * undef ?
+ * PG Status (discarded, would be '0' anyway)
*/
p += get_word(p, NULL);
/*
* selector args
*/
- for (k = 0; k < num_pg_args; k++)
- p += get_word(p, NULL);
+ for (k = 0; k < num_pg_args; k++) {
+ if (!strncmp(mpp->selector,
+ "least-pending", 13)) {
+ p += get_word(p, &word);
+ if (sscanf(word,"%d:*d",
+ &def_minio) == 1 &&
+ def_minio != mpp->minio)
+ mpp->minio = def_minio;
+ } else
+ p += get_word(p, NULL);
+ }
}
}
return 0;