ca_host_name returns empty string if dns server hasnt responded yet?

Bug #541381 reported by Jeff Hill
6
This bug affects 1 person
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::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 ] = '

Original Mantis Bug: mantis-354
    http://www.aps.anl.gov/epics/mantis/view_bug_page.php?f_id=354

Tags: ca 3.14
Revision history for this message
Andrew Johnson (anj) wrote :

R3.14.11 released.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.