ca_host_name() now returns the host name of the client, not the host:port of the server

Bug #541229 reported by evans
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
EPICS Base
Fix Released
High
Jeff Hill

Bug Description

ca_host_name now returns the host name where the client is running (not very useful). It used to return the host name and port of the server (very useful, if not essential).

Additional information:
The new behavior is with 3.14.7. It returns server-name:port with
3.13.10. I believe it also returned the server-name:port with
previous versions of 3.14, but I do not know when the change occurred.
It is used in PvInfo for MEDM and in other clients in exception
messages and sometimes on demand as with MEDM. It is not very useful
as it stands, whereas it was frequently used before. It is violating
the otherwise pretty successful attempt to keep the client behavior
and coding the same for 3.13 and 3.14.

Version: R3.14.7

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

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

I can confirmed that ca_host_name() works properly in R3.14.6; it can be demonstrated to be broken in R3.14.7 using the Base cainfo program.

Revision history for this message
Jeff Hill (johill-lanl) wrote :
Download full text (8.1 KiB)

I applied this patch

Index: nciu.cpp
===================================================================
RCS file: /net/phoebus/epicsmgr/cvsroot/epics/base/src/ca/nciu.cpp,v
retrieving revision 1.77.2.24
diff -c -r1.77.2.24 nciu.cpp
*** nciu.cpp 19 Oct 2004 20:42:12 -0000 1.77.2.24
--- nciu.cpp 11 Apr 2005 21:20:18 -0000
***************
*** 413,418 ****
--- 413,424 ----
          guard, pBuf, bufLength );
  }

+ const char * nciu::pHostName (
+ epicsGuard < epicsMutex > & guard ) const throw ()
+ {
+ return this->piiu->pHostName ( guard );
+ }
+
  bool nciu::ca_v42_ok (
      epicsGuard < epicsMutex > & guard ) const
  {
Index: nciu.h
===================================================================
RCS file: /net/phoebus/epicsmgr/cvsroot/epics/base/src/ca/nciu.h,v
retrieving revision 1.28.2.16
diff -c -r1.28.2.16 nciu.h
*** nciu.h 19 Oct 2004 20:42:39 -0000 1.28.2.16
--- nciu.h 11 Apr 2005 21:22:03 -0000
***************
*** 262,269 ****
      arrayElementCount nativeElementCount (
          epicsGuard < epicsMutex > & ) const;
      static void stringVerify ( const char *pStr, const unsigned count );
! virtual void ioCompletionNotify (
          epicsGuard < epicsMutex > &, class baseNMIU & );
   nciu ( const nciu & );
   nciu & operator = ( const nciu & );
      void * operator new ( size_t );
--- 262,271 ----
      arrayElementCount nativeElementCount (
          epicsGuard < epicsMutex > & ) const;
      static void stringVerify ( const char *pStr, const unsigned count );
! void ioCompletionNotify (
          epicsGuard < epicsMutex > &, class baseNMIU & );
+ const char * pHostName (
+ epicsGuard < epicsMutex > & guard ) const throw ();
   nciu ( const nciu & );
   nciu & operator = ( const nciu & );
      void * operator new ( size_t );
Index: netiiu.cpp
===================================================================
RCS file: /net/phoebus/epicsmgr/cvsroot/epics/base/src/ca/netiiu.cpp,v
retrieving revision 1.45.2.9
diff -c -r1.45.2.9 netiiu.cpp
*** netiiu.cpp 19 Oct 2004 20:43:45 -0000 1.45.2.9
--- netiiu.cpp 11 Apr 2005 21:21:02 -0000
***************
*** 110,116 ****
  }

  const char * netiiu::pHostName (
! epicsGuard < epicsMutex > & ) const
  {
      return pHostNameNetIIU;
  }
--- 110,116 ----
  }

  const char * netiiu::pHostName (
! epicsGuard < epicsMutex > & ) const throw ()
  {
      return pHostNameNetIIU;
  }
Index: netiiu.h
===================================================================
RCS file: /net/phoebus/epicsmgr/cvsroot/epics/base/src/ca/netiiu.h,v
retrieving revision 1.17.2.9
diff -c -r1.17.2.9 netiiu.h
*** netiiu.h 19 Oct 2004 20:46:19 -0000 1.17.2.9
--- netiiu.h 11 Apr 2005 21:21:02 -0000
***************
*** 42,48 ****
          epicsGuard < epicsMutex > &, char * pBuf,
          unsigned bufLength ) const throw () = 0;
      virtual const char * pHostName (
! epicsGuard < epicsMutex > & ) const = 0;
      virtual bool ca_v41_ok (
          epicsGuard < epicsMutex > & ) const = 0;
      virtual bool ca_v42_ok (
--- 42,48 ----
          epicsGuard < epicsMutex > &, char * pBuf,
          unsigned bufLength ) const throw () = 0;
      virtual const char...

Read more...

Revision history for this message
Jeff Hill (johill-lanl) wrote :

I confirmed that cainfo is working correctly

Revision history for this message
Jeff Hill (johill-lanl) wrote :

fixed in R3.14.8

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

R3.14.8 Release.

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.