Dirk,
I think the IP address would be better than an empty string.
TBOMK, it does return the dotted IP address as a string if the DNS transaction hasn't completed yet. Let me know if that isn’t the case.
unsigned hostNameCache::getName (
char * pBuf, unsigned bufSize ) const
{
if ( bufSize == 0u ) {
return 0u;
}
epicsGuard < epicsMutex > guard ( this->mutex );
if ( this->nameLength > 0u ) {
if ( this->nameLength < bufSize ) {
strcpy ( pBuf, this->hostNameBuf );
return this->nameLength;
}
else {
unsigned reducedSize = bufSize - 1u;
strncpy ( pBuf, this->hostNameBuf, reducedSize );
pBuf [ reducedSize ] = '\0';
return reducedSize;
}
}
else {
osiSockAddr tmpAddr = this->dnsTransaction.address ();
return sockAddrToDottedIP ( &tmpAddr.sa, pBuf, bufSize );
}
}
Jeff
______________________________________________________
Jeffrey O. Hill Email [email protected]
LANL MS H820 Voice 505 665 1831
Los Alamos NM 87545 USA FAX 505 665 5107
Message content: TSPA
-----Original Message-----
From: Dirk Zimoch [mailto:[email protected]]
Sent: Wednesday, July 22, 2009 12:46 AM
To: Jeff Hill
Cc: [email protected]
Subject: Re: cainfo does display host info
Jeff Hill wrote:
I'm fully open to alternative suggestions.
I think the IP address would be better than an empty string.
--
Dr. Dirk Zimoch
Paul Scherrer Institut, WBGB/006
5232 Villigen PSI, Switzerland
Phone +41 56 310 5182