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()){ | ||||
|  |  | |||
|  | @ -264,7 +264,7 @@ namespace Mist { | |||
|       curData[tid].dataSize += lastPack.getDataLen(); | ||||
|       curData[tid].partNum ++; | ||||
|       bookKeeping[tid].curPart ++; | ||||
|       DEBUG_MSG(DLVL_DONTEVEN, "Track %d:%d on page %d, being part %d of key %d", lastPack.getTrackId(), lastPack.getTime(), bookKeeping[tid].first, curData[tid].partNum, curData[tid].keyNum); | ||||
|       DEBUG_MSG(DLVL_DONTEVEN, "Track %ld:%llu on page %d, being part %d of key %d", lastPack.getTrackId(), lastPack.getTime(), bookKeeping[tid].first, curData[tid].partNum, curData[tid].keyNum); | ||||
|       getNext(false); | ||||
|     } | ||||
|     for (std::map<int, DTSC::Track>::iterator it = myMeta.tracks.begin(); it != myMeta.tracks.end(); it++) { | ||||
|  |  | |||
|  | @ -638,6 +638,7 @@ namespace Mist { | |||
|   } | ||||
| 
 | ||||
|   void Output::stats(){ | ||||
|     static bool setHost = true; | ||||
|     if (!isInitialized){ | ||||
|       return; | ||||
|     } | ||||
|  | @ -647,7 +648,10 @@ namespace Mist { | |||
|         lastStats = now; | ||||
|         IPC::statExchange tmpEx(statsPage.getData()); | ||||
|         tmpEx.now(now); | ||||
|         tmpEx.host(myConn.getHost()); | ||||
|         if (setHost){ | ||||
|           tmpEx.host(myConn.getBinHost()); | ||||
|           setHost = false; | ||||
|         } | ||||
|         tmpEx.streamName(streamName); | ||||
|         tmpEx.connector(capa["name"].asString()); | ||||
|         tmpEx.up(myConn.dataUp()); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Thulinma
						Thulinma