connection_t *broadcast;
static int connection_compare(const connection_t *a, const connection_t *b) {
- return (void *)a - (void *)b;
+ return a < b ? -1 : a == b ? 0 : 1;
}
void init_connections(void) {
if(c->hischallenge)
free(c->hischallenge);
+ if(c->config_tree)
+ exit_configuration(&c->config_tree);
+
if(c->buffer)
bufferevent_free(c->buffer);
for(node = connection_tree->head; node; node = node->next) {
c = node->data;
if(evbuffer_add_printf(out,
- _(" %s at %s options %lx socket %d status %04x\n"),
- c->name, c->hostname, c->options, c->socket,
- c->status.value) == -1)
+ _(" %s at %s options %lx socket %d status %04x\n"),
+ c->name, c->hostname, c->options, c->socket,
+ bitfield_to_int(&c->status, sizeof c->status)) == -1)
return errno;
}
cp();
- asprintf(&fname, "%s/hosts/%s", confbase, c->name);
+ xasprintf(&fname, "%s/hosts/%s", confbase, c->name);
x = read_config_file(c->config_tree, fname);
free(fname);