ca_host_name returns empty string if dns server hasnt responded yet?
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
EPICS Base |
Invalid
|
Wishlist
|
Jeff Hill |
Bug Description
From Ernest (and Dirk):
That does not work for me.
Only when I turn on "nscd" on my linux systems do things work reliably.
When nscd is not running most of the time I get the empty string.
Thanks,
Ernest
Jeff Hill wrote:
> 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:
> 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 ] = '
Original Mantis Bug: mantis-354
http://
R3.14.11 released.