/* assign default values */
if (control_uri == NULL) {
- ret = asprintf(&default_address, "tcp://0.0.0.0:%d",
- DEFAULT_NETWORK_CONTROL_PORT);
+ ret = asprintf(&default_address,
+ "tcp://" DEFAULT_NETWORK_CONTROL_BIND_ADDRESS ":%d",
+ DEFAULT_NETWORK_CONTROL_PORT);
if (ret < 0) {
PERROR("asprintf default data address");
goto exit;
}
}
if (data_uri == NULL) {
- ret = asprintf(&default_address, "tcp://0.0.0.0:%d",
- DEFAULT_NETWORK_DATA_PORT);
+ ret = asprintf(&default_address,
+ "tcp://" DEFAULT_NETWORK_DATA_BIND_ADDRESS ":%d",
+ DEFAULT_NETWORK_DATA_PORT);
if (ret < 0) {
PERROR("asprintf default data address");
goto exit;
}
}
if (live_uri == NULL) {
- ret = asprintf(&default_address, "tcp://0.0.0.0:%d",
- DEFAULT_NETWORK_VIEWER_PORT);
+ ret = asprintf(&default_address,
+ "tcp://" DEFAULT_NETWORK_VIEWER_BIND_ADDRESS ":%d",
+ DEFAULT_NETWORK_VIEWER_PORT);
if (ret < 0) {
PERROR("asprintf default viewer control address");
goto exit;
connection_delete(relay_connections_ht, conn);
/* For the control socket, we try to destroy the session. */
- if (conn->type == RELAY_CONTROL) {
+ if (conn->type == RELAY_CONTROL && conn->session) {
destroy_session(conn->session, conn->sessions_ht);
}