Commit Graph
363 Commits
Author SHA1 Message Date
zimoch 6a75f3258b add EPICS_ALLOW_MULTIPLE_IOCS to prevent starting more than one IOC on one machine 2018-02-28 16:53:35 +01:00
zimoch 1b9a104215 install additional header file for iocStats 2018-02-22 17:16:55 +01:00
Michael Davidsaver 734d16291f rsrv: buffer for IP too small
An IPv4 address and port number
has 21 characters max.
2018-02-01 09:42:51 -08:00
Michael Davidsaver 5c8e5c52ef rsrv: fix recv() error handling on WIN32
For WIN32 osiSockIoctl_t is unsigned, so

> osiSockIoctl_t nchars = recv(...

is casting signed -> unsigned which treats
errors as success.
2017-08-01 17:02:41 +02:00
Michael Davidsaver 546df1c1f0 rsrv: export CASDEBUG to iocsh 2017-08-01 17:02:41 +02:00
Michael Davidsaver 603331e7a5 rsrv: flush any queued messages before forced disconnect
Avoid loss of various ERROR messages which camessage()
has queued.
2017-08-01 16:44:48 +02:00
Michael Davidsaver 4b272cc0cf rsrv: locking in cas_send_bs_msg()
Must lock around "pclient->send.stk = 0u;"
2017-08-01 16:44:48 +02:00
Michael Davidsaver 619a99bf99 rsrv: missing send lock around send_err() 2017-08-01 16:44:48 +02:00
Michael Davidsaver 1f8cb740f1 rsrv: drop un-commited VERSION message
This is a no-op as cas_commit_msg() isn't called.
A VERSION message is already queued during create_tcp_client().
2017-08-01 16:44:29 +02:00
Michael Davidsaver 322f7a97de rsrv: add some comments 2017-08-01 16:44:29 +02:00
Michael Davidsaver 0fc770166c rsrv: avoid possible overflow in vsend_err()
Accounting of message size doesn't take into account
space used by header of failed message (16 or 24 bytes).
This would allow a theoretical really long error message
to overflow the send buffer by 16 or 24 bytes.
2017-08-01 16:44:08 +02:00
Andrew Johnson 9c859ffdca Protect casStatsFetch() if called before rsrv_init()
Also ensures clientQ is initialized before creating clientQlock.

Fixes LP: #1694966
2017-06-01 15:37:34 -05:00
Michael Davidsaver e430d097b7 ioc/rsrv: bounds check DBR
avoid array overrun when evaluating dbr_size_n() macro.
2017-05-03 16:49:28 -04:00
Andrew Johnson 3e58c59377 Fix CA server bind issue from Freddie Akeroyd 2017-01-19 12:33:54 -06:00
Andrew Johnson 94397b52fc Resolve some cppcheck errors & warnings 2016-12-07 13:53:26 -06:00
Michael DavidsaverandMichael Davidsaver 428268a71e rsrv: avoid strlen() on possible unterminated strings
Detect these w/o risk of SIGSEGV
2014-01-11 10:59:57 -05:00
Andrew Johnson f4a16a1e1e Remaining Revision-Id keywords in source 2016-05-22 05:43:09 +02:00
Michael Davidsaver 51dd371784 rsrv: add rsrvCS_shutdown to avoid race in destroyAllChannels()
A race can occur between rsrv and cac by way of asLib
whereby casAccessRightsCB() is called after
a channel_in_use has been removed from
chanList/chanPendingUpdateARList.
casAccessRightsCB() would then attempt to remove
the node again, causing corruption.

Create a new rsrvCS_shutdown state when the
channel is not in either list.

Attempt to resolve lp:1571224
2016-04-26 17:06:22 -04:00
Andrew Johnson 99d331e50a Print timestamp with bad UDP msg errors 2016-02-11 14:36:48 -06:00
Andrew Johnson 4a0880003c Support MinGW cross-builds on linux-x86 and x86_64 2015-02-24 14:30:42 -06:00
Andrew Johnson f16bdb0c83 Merged trap-write-data branch 2015-02-17 14:02:15 -06:00
Andrew Johnson 681a996bf0 Unifying rsrv error messages 2015-02-17 13:59:13 -06:00
Andrew Johnson c5ded30684 Extended asTrapWrite to provide put data
Backwards-compatible enhancement to the asTrapWrite API to provide
listener routines with the data being put by the client.
The asTrapWriteMessage structure is extended with 3 new fields
for data type, element count and a pointer to the source buffer.

Tim Mooney requested this enhancement for his caPutRecorder code,
which doesn't work if the record overwrites the new value within
its process() routine, e.g. when jogging a motor record.
2015-02-16 16:30:52 -06:00
Andrew Johnson 01f0fdbf1e More file permission fixes. 2013-08-19 15:46:51 -05:00
Jeff Hill 89d000be08 fixed problems with ca clear channel protocol during reload of the access security file.
See https://bugs.launchpad.net/epics-base/+bug/1091401.
2012-12-18 14:32:12 -07:00
Andrew Johnson c1cebc89bf rsrv: Add epicsShareFunc to casStatsFetch()
Fixes lp:999167
2012-05-14 11:16:33 -05:00
Andrew Johnson 243baddbf6 Add an Init stat to all thread control variables
This makes the uninitilized value not the Run state.
2012-05-04 13:38:59 -05:00
Jeff HillandAndrew Johnson a52b995ca2 rsrv: Fixed large array element count bug
Reverted commit 12095.2.5 which introduced an incorrect optimization.

Fixes:701673
2011-01-13 16:21:31 -06:00
Jeff Hill 36175b1368 merged in R3.14.12 2010-11-01 15:15:51 -06:00
Jeff Hill e372a83096 neglected to unlock on error return path 2010-11-01 15:01:04 -06:00
Jeff Hill 3ad06eb0a3 fixed request and response bytes amount was revered in printf 2010-11-01 15:00:02 -06:00
Andrew Johnson fbda9f3280 RCS keyword updates for Bazaar
Replaced $Id$ and $Header$ keywords with $Revision-Id$
Deleted $Log$ keywords and any log messages
2010-10-05 14:27:37 -05:00
Andrew Johnson 0c4746dd66 Moved new variable definitions to the beginning of their block.
Older C compilers such as vxWorks 5.x insist on this.
2010-08-13 12:59:50 -05:00
Michael AbbottandAndrew Johnson e54b631b8d Guard memset in camessage.c to prevent wild memory overrun if mismatch
between payload and data size.
2010-08-11 16:49:46 -05:00
Michael AbbottandAndrew Johnson 9d9ba1a442 Add CA message header size optimisation.
If a packet is sufficiently small it can be worth the small
optimisation of saving the 8 bytes in a large packet header.
2010-08-11 16:42:44 -05:00
Michael AbbottandAndrew Johnson 30f0871c2b Drive-by refactoring in caserverio.c
Minor refactoring of code block in cas_copy_in_header() to gather
common header code.
2010-08-11 16:41:15 -05:00
Michael AbbottandAndrew Johnson e87bbef75c Update rsrv to support V4.13 protocol extension.
The rsrv server is updated in this commit to deliver variable sized
waveforms in response to a zero length request, implementing an
extension to the v4 EPICS protocol tied to minor version 13.

The core of the changes are in read_reply, rsrv/camessage.c, which first
reserves packet space for the largest possible response, but then resizes
the packet according to how much data is actually returned from the
database.
2010-08-11 16:38:49 -05:00
Andrew Johnson eda402cf66 Merged Ralph's ca-over-tcp branch.
Fixed some vxWorks compile errors, and made a number of edits
to the HTML in the CAref.html documentation.
2010-08-10 16:05:46 -05:00
Ralph Lange 23612a7afe Merged Codeathon 2008 changes (10292..10293 on cvs-trunk branch).
* Fixed conflicts until base compiles
 * COMPLETELY UNTESTED
2010-04-06 17:59:35 -04:00
Andrew Johnson 4e0ab97038 (M. Davidsaver): static keyword is part of C89,
remove all uses and internal definitions of LOCAL macro
2009-07-09 16:37:24 +00:00
Andrew Johnson f1b1c6d105 Handle SOCK_EINTR without generating warnings. 2009-05-08 21:50:37 +00:00
Ralph Lange 7fccc59fe9 ANSIfication of stuff (mostly missing argument types in declarations) 2009-04-03 17:46:26 +00:00
Janet B. Anderson 3d588b13fc Changed LIBSRCS to LIB_SRCS. 2009-03-11 18:51:25 +00:00
Jeff Hill 2bf9959e11 committed a fix for mantis 302 2008-09-19 23:27:52 +00:00
Andrew Johnson 8b88489b90 Latest gcc doesn't like variables named 'true'. 2008-09-03 22:30:18 +00:00
Janet B. Anderson a5ea63f7d8 RCS files now used for all cygwin and mingw builds. 2008-08-27 18:33:59 +00:00
Andrew Johnson c9bc70bd6a Added iocBuild, iocPause and iocRun commands.
These are mainly for redundant IOCs, but may be useful elsewhere.
iocBuild prepares the IOC and freezes it just before it goes live.
A subsequent iocRun kicks it into life, or restarts it when paused.
iocPause freezes all scan tasks and disconnects the server.
2008-07-09 21:31:56 +00:00
Andrew Johnson 0363341826 Remove duplicate taskwdInsert() call for the CAS-UDP task. 2008-05-20 17:45:18 +00:00
Jeff Hill cff69ead6b removed inadvertent ! at beginning of line in if statement 2007-11-07 23:17:06 +00:00
Jeff Hill 26339cdbed additional changes for the mantis 296 pach 2007-11-06 17:58:36 +00:00