"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/cfgparse.c" between
haproxy-2.0.13.tar.gz and haproxy-2.0.14.tar.gz

About: HAProxy is a TCP/HTTP reverse proxy which is particularly suited for high availability environments. LTS (Long-Term Support) release.

cfgparse.c  (haproxy-2.0.13):cfgparse.c  (haproxy-2.0.14)
skipping to change at line 3700 skipping to change at line 3700
idle_conn_cleanup[i]->process = s rv_cleanup_toremove_connections; idle_conn_cleanup[i]->process = s rv_cleanup_toremove_connections;
idle_conn_cleanup[i]->context = N ULL; idle_conn_cleanup[i]->context = N ULL;
LIST_INIT(&toremove_connections[i ]); LIST_INIT(&toremove_connections[i ]);
} }
} }
newsrv->idle_orphan_conns = calloc((unsigned shor t)global.nbthread, sizeof(*newsrv->idle_orphan_conns)); newsrv->idle_orphan_conns = calloc((unsigned shor t)global.nbthread, sizeof(*newsrv->idle_orphan_conns));
if (!newsrv->idle_orphan_conns) if (!newsrv->idle_orphan_conns)
goto err; goto err;
for (i = 0; i < global.nbthread; i++) for (i = 0; i < global.nbthread; i++)
LIST_INIT(&newsrv->idle_orphan_conns[i]); LIST_INIT(&newsrv->idle_orphan_conns[i]);
newsrv->curr_idle_thr = calloc(global.nbthread, s izeof(int)); newsrv->curr_idle_thr = calloc(global.nbthread, s izeof(*newsrv->curr_idle_thr));
if (!newsrv->curr_idle_thr) if (!newsrv->curr_idle_thr)
goto err; goto err;
continue; continue;
err: err:
ha_alert("parsing [%s:%d] : failed to allocate id le connection tasks for server '%s'.\n", ha_alert("parsing [%s:%d] : failed to allocate id le connection tasks for server '%s'.\n",
newsrv->conf.file, newsrv->conf.line, ne wsrv->id); newsrv->conf.file, newsrv->conf.line, ne wsrv->id);
cfgerr++; cfgerr++;
continue; continue;
} }
} }
skipping to change at line 3941 skipping to change at line 3941
if (t->peers.p && t->peers.p->peers_fe) { if (t->peers.p && t->peers.p->peers_fe) {
t->peers.p->peers_fe->bind_proc |= p->bind_proc; t->peers.p->peers_fe->bind_proc |= p->bind_proc;
} }
} }
} }
if (cfg_peers) { if (cfg_peers) {
struct peers *curpeers = cfg_peers, **last; struct peers *curpeers = cfg_peers, **last;
struct peer *p, *pb; struct peer *p, *pb;
/* In the case the peers frontend was not initialized by a
stick-table used in the configuration, set its bind_proc
by default to the first process. */
while (curpeers) {
if (curpeers->peers_fe) {
if (curpeers->peers_fe->bind_proc == 0)
curpeers->peers_fe->bind_proc = 1;
}
curpeers = curpeers->next;
}
curpeers = cfg_peers;
/* Remove all peers sections which don't have a valid listener, /* Remove all peers sections which don't have a valid listener,
* which are not used by any table, or which are bound to more * which are not used by any table, or which are bound to more
* than one process. * than one process.
*/ */
last = &cfg_peers; last = &cfg_peers;
while (*last) { while (*last) {
struct stktable *t;
curpeers = *last; curpeers = *last;
if (curpeers->state == PR_STSTOPPED) { if (curpeers->state == PR_STSTOPPED) {
/* the "disabled" keyword was present */ /* the "disabled" keyword was present */
if (curpeers->peers_fe) if (curpeers->peers_fe)
stop_proxy(curpeers->peers_fe); stop_proxy(curpeers->peers_fe);
curpeers->peers_fe = NULL; curpeers->peers_fe = NULL;
} }
else if (!curpeers->peers_fe || !curpeers->peers_fe->id) { else if (!curpeers->peers_fe || !curpeers->peers_fe->id) {
ha_warning("Removing incomplete section 'peers %s ' (no peer named '%s').\n", ha_warning("Removing incomplete section 'peers %s ' (no peer named '%s').\n",
curpeers->id, localpeer); curpeers->id, localpeer);
if (curpeers->peers_fe)
stop_proxy(curpeers->peers_fe);
curpeers->peers_fe = NULL;
} }
else if (atleast2(curpeers->peers_fe->bind_proc)) { else if (atleast2(curpeers->peers_fe->bind_proc)) {
/* either it's totally stopped or too much used * / /* either it's totally stopped or too much used * /
if (curpeers->peers_fe->bind_proc) { if (curpeers->peers_fe->bind_proc) {
ha_alert("Peers section '%s': peers refer enced by sections " ha_alert("Peers section '%s': peers refer enced by sections "
"running in different processes (%d different ones). " "running in different processes (%d different ones). "
"Check global.nbproc and all tab les' bind-process " "Check global.nbproc and all tab les' bind-process "
"settings.\n", curpeers->id, my_ popcountl(curpeers->peers_fe->bind_proc)); "settings.\n", curpeers->id, my_ popcountl(curpeers->peers_fe->bind_proc));
cfgerr++; cfgerr++;
} }
skipping to change at line 4020 skipping to change at line 4036
free(p->id); free(p->id);
free(p); free(p);
p = pb; p = pb;
} }
/* Destroy and unlink this curpeers section. /* Destroy and unlink this curpeers section.
* Note: curpeers is backed up into *last. * Note: curpeers is backed up into *last.
*/ */
free(curpeers->id); free(curpeers->id);
curpeers = curpeers->next; curpeers = curpeers->next;
/* Reset any refereance to this peers section in the list
of stick-tables */
for (t = stktables_list; t; t = t->next) {
if (t->peers.p && t->peers.p == *last)
t->peers.p = NULL;
}
free(*last); free(*last);
*last = curpeers; *last = curpeers;
} }
} }
for (t = stktables_list; t; t = t->next) { for (t = stktables_list; t; t = t->next) {
if (t->proxy) if (t->proxy)
continue; continue;
if (!stktable_init(t)) { if (!stktable_init(t)) {
ha_alert("Proxy '%s': failed to initialize stick-table.\n ", t->id); ha_alert("Proxy '%s': failed to initialize stick-table.\n ", t->id);
 End of changes. 5 change blocks. 
1 lines changed or deleted 23 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)