1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

websocket: add destinations to websocket_print()

This commit is contained in:
Steffen Vogel 2017-04-24 18:11:05 +02:00
parent 86ec387b9a
commit 414fcc72f1

View file

@ -409,19 +409,21 @@ char * websocket_print(struct node *n)
char *buf = NULL;
buf = strcatf(&buf, "dests=");
buf = strcatf(&buf, "destinations=[ ");
for (size_t i = 0; i < list_length(&w->destinations); i++) {
struct lws_client_connect_info *in = list_at(&w->destinations, i);
struct websocket_destination *d = list_at(&w->destinations, i);
buf = strcatf(&buf, "%s://%s:%d/%s",
in->ssl_connection ? "https" : "http",
in->address,
in->port,
in->path
buf = strcatf(&buf, "%s://%s:%d/%s ",
d->info.ssl_connection ? "wss" : "ws",
d->info.address,
d->info.port,
d->info.path
);
}
buf = strcatf(&buf, "]");
return buf;
}