Code review comment for ~bhill/epics-base:pvAccess-envDefs.h

Revision history for this message
Bruce Hill (bhill) wrote :

So looking more in to how defaults are handled in CA vs PVA code, I needed to change
CONFIG_ENV to set most of the EPICS_PVAS_* defaults to empty or empty string.
The empty setting allows code such as this from rsrv/caservertask.c to use
EPICS_CA_SERVER_PORT as the default for EPICS_CAS_SERVER_PORT, even if neither are
actually defined as process environment variables.

if ( envGetConfigParamPtr ( &EPICS_CAS_SERVER_PORT ) ) {
    ca_server_port = envGetInetPortConfigParam ( &EPICS_CAS_SERVER_PORT,
                                 (unsigned short) CA_SERVER_PORT );
}
else {
    ca_server_port = envGetInetPortConfigParam ( &EPICS_CA_SERVER_PORT,
                                 (unsigned short) CA_SERVER_PORT );
}

My point from this is that the envGet*ConfigParam*() routines don't
provide any insight to client code such as in iocStats() re this defaulting
of EPICS_CAS_SERVER_PORT to EPICS_CA_SERVER_PORT, which I think refutes
part of Michael's objection.

As I see it, the make variables defined in CONFIG_ENV allow user overrides
via CONFIG_SITE_ENV to set site defaults for CA environment parameters.

The only change needed to make pvAccess compatible is to use those make
variables to override the default values in pvAccess/src/pva/pv/pvaConstants.h

pvAccess wouldn't need to use the envGet*ConfigParam*() calls as it's current
code in src/server/serverContext.cpp that calls getPropertyAs*() routines
can stay as is.

« Back to merge proposal