Fixed hostname in statistics to properly be in packed binary format, internally.
This commit is contained in:
parent
ba3880d78d
commit
c26661b690
3 changed files with 16 additions and 3 deletions
|
@ -48,7 +48,16 @@ void Controller::SharedMemStats(void * config){
|
|||
/// It updates the internally saved statistics data.
|
||||
void Controller::statStorage::update(IPC::statExchange & data) {
|
||||
if (!streamName.size()){
|
||||
host = data.host();
|
||||
std::string tHost = data.host();
|
||||
if (tHost.substr(0, 12) == std::string("\000\000\000\000\000\000\000\000\000\000\377\377", 12)){
|
||||
char tmpstr[16];
|
||||
snprintf(tmpstr, 16, "%hhu.%hhu.%hhu.%hhu", tHost[12], tHost[13], tHost[14], tHost[15]);
|
||||
host = tmpstr;
|
||||
}else{
|
||||
char tmpstr[40];
|
||||
snprintf(tmpstr, 40, "%0.2x%0.2x:%0.2x%0.2x:%0.2x%0.2x:%0.2x%0.2x:%0.2x%0.2x:%0.2x%0.2x:%0.2x%0.2x:%0.2x%0.2x", tHost[0], tHost[1], tHost[2], tHost[3], tHost[4], tHost[5], tHost[6], tHost[7], tHost[8], tHost[9], tHost[10], tHost[11], tHost[12], tHost[13], tHost[14], tHost[15]);
|
||||
host = tmpstr;
|
||||
}
|
||||
streamName = data.streamName();
|
||||
}
|
||||
if (!connector.size()){
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue