Commit d3b17ce4 authored by Adam Knapp's avatar Adam Knapp Committed by Botond Baranyi

Improving HC -s parameter handling

Signed-off-by: Adam Knapp's avatarAdam Knapp <adam.knapp@ericsson.com>
parent ee438f11
......@@ -810,6 +810,11 @@ void TTCN_Communication::send_version()
text_buf.push_int(TRANSPORT_INET_STREAM);
if (unix_stream_supported)
text_buf.push_int(TRANSPORT_UNIX_STREAM);
if (local_addr_set) {
text_buf.push_string(hcnh.get_local_addr_str());
} else {
text_buf.push_string("");
}
send_message(text_buf);
}
......
......@@ -602,6 +602,12 @@ host_struct *MainController::add_new_host(unknown_connection *conn)
"Transport type %s must be supported anyway.",
get_transport_name(TRANSPORT_INET_STREAM));
}
char *hc_addr = text_buf->pull_string();
if (strlen(hc_addr)) {
new_host->ip_addr = IPAddress::create_addr(hc_addr);
Free(new_host->hostname);
new_host->hostname = mcopystr(new_host->ip_addr->get_host_str());
}
new_host->log_source = mprintf("HC@%s", new_host->hostname_local);
new_host->hc_state = HC_IDLE;
new_host->hc_fd = fd;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment