Most errors found with:
codespell -L cach,thst,odly,aslo,parm,parms,inpu,ges,prset,pevent,ptd,pring,valu,noo,noe,ned,inout,ro,siz,froms,nd,fo,singl,sart,multy,tthe,allong,ment,inate,nodel,tring,alse,ture,thi,wille,numer
Some more manually found (its -> it's)
c++20: Do not use apostrophe (e.g. can't) in unquoted #error message
* Allow CA clients to determine the server protocol version
Adds a call to the CA client API that allows a client to determine the server's
protocol minor version number. This is needed to allow the ca-nameserver to
report a server's protocol version correctly to a client.
* ca_host_minor_protocol return for disconnected channels
ca_host_minor_protocol now explicitly returns CA_UKN_MINOR_VERSION for a disconnected channel.
Import all function documentations, return code reference
into the header files, as doc comments,
in the hopes of moving the CAref.html manual to docs.epics-controls.org,
which will be done in a later PR.
Also added doc comments to some other low-hanging fruits,
for example when plain comments where near, or when it was obvious to do so.
Markdown can be generated from .pod and .dbd.pod files.
Markdown will be generated and installed by "make inc".
Co-authored-by: Timo Korhonen <timo.korhonen@ess.eu>
Co-authored-by: Andrew Johnson <anj@anl.gov>
Found here at ESS:
(all in one line)
EPICS_CA_ADDR_LIST=averylonghostname.mylabnetwork.technicalnetwork.example.com
EPICS_CA_AUTO_ADDR_LIST=NO
caget somePVnam
leads to something like this:
CA.Client.Exception...............................................
Warning: "Empty PV search address list"
Source File: ../udpiiu.cpp line 403
Current Time: Thu Jun 09 2022 10:10:47.804161447
Problem desription:
addAddrToChannelAccessAddressList() will collect what ever we specify in
EPICS_CA_ADDR_LIST for channel access.
That function will add IP-addresses to the search list.
hostnames are possible, but are ignored if longer than 32 bytes,
because buf is too short.
If a hostname can be resolved into an IP, that is fine,
if not that is "fine as well" (better say: silently ignored):
If, and only if, EPICS_CA_AUTO_ADDR_LIST=NO is given then the one
and only too long hostname will be ignored and lead to an
"Empty PV search address list".
If EPICS_CA_AUTO_ADDR_LIST=YES (or nothing) is specified, the search list
is not empty, and EPICS will search all broadcast addresses.
This will eventually lead into a timout.
Solution:
Increase the buf size in addAddrToChannelAccessAddressList() from 32 to 256
The maximum length for a hostname is 255:
https://www.ietf.org/rfc/rfc1034.txt
If we add one byte for the string terminating '\0', we need 256 bytes.
And yes, this patch neglets the fact that a user can specify HOSTNAME:PORT,
which may need another 6 bytes. To put it the other way around:
In this case the hostname length is limited to 250 bytes,
which is still long enough in practice.
libCa shouldn't cause an application to abort with an uncaught
exception on a machine that has timezone problems just because
we can't convert the current time into a string.
The other Perl scripts that use FindBin for their lib path could
have the same changes applied, but these two scripts are the ones
normally run by hand so might get soft-linked by an installer.
Without this change these scripts don't actually work if run from
a soft-link instead of directly.
* CPP's defined() is UB outside of a #if line
* Use (void)! cast to prevent recent GCCs & glibc from warning
about ignoring the return status from chdir()