mirror of https://gerrit.osmocom.org/osmo-sysmon
Disconnect properly on errors so we can reconnect
Change-Id: Id134be34a24e91a4c0b8a8d11cf4df9593dae687
This commit is contained in:
parent
9b2d511813
commit
1c2ef1ab69
|
@ -279,6 +279,15 @@ static int ctrl_client_poll(struct ctrl_client *cc, struct value_node *parent)
|
||||||
llist_for_each_entry(ccgv, &cc->get_vars, list) {
|
llist_for_each_entry(ccgv, &cc->get_vars, list) {
|
||||||
char *value = simple_ctrl_get(cc->sch, ccgv->cfg.name);
|
char *value = simple_ctrl_get(cc->sch, ccgv->cfg.name);
|
||||||
|
|
||||||
|
/* FIXME: Distinguish between ERROR reply and
|
||||||
|
* connection issues */
|
||||||
|
/* Close connection on error */
|
||||||
|
if (!value) {
|
||||||
|
simple_ctrl_close(cc->sch);
|
||||||
|
cc->sch = NULL;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
value_node_add(vn_clnt, vn_clnt, ccgv->cfg.name, value);
|
value_node_add(vn_clnt, vn_clnt, ccgv->cfg.name, value);
|
||||||
free(value); /* no talloc, this is from sscanf() */
|
free(value); /* no talloc, this is from sscanf() */
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue