Merge lp:~bhill/epics-base/pcas-vararray-3.16 into lp:~epics-core/epics-base/3.16

Proposed by Bruce Hill
Status: Rejected
Rejected by: Ralph Lange
Proposed branch: lp:~bhill/epics-base/pcas-vararray-3.16
Merge into: lp:~epics-core/epics-base/3.16
Diff against target: 228 lines (+39/-26)
3 files modified
src/ca/legacy/pcas/generic/caHdrLargeArray.h (+1/-1)
src/ca/legacy/pcas/generic/casStrmClient.cc (+37/-24)
src/ca/legacy/pcas/generic/casStrmClient.h (+1/-1)
To merge this branch: bzr merge lp:~bhill/epics-base/pcas-vararray-3.16
Reviewer Review Type Date Requested Status
Ralph Lange Disapprove
Review via email: mp+308318@code.launchpad.net

Description of the change

Here's a clean branch w/ the pcas vararray support for 3.16.
I realized my prior branch pcas-varray-3.15 was based on 3.15 but
ended up as a merge into 3.16. My bad.

Hopefully this will help get the changes to 3.16 and 3.15 if approved.

Thanks to Ralph for helping to clean up the 3.14 branch!

Cheers,
- Bruce

To post a comment you must log in.
Revision history for this message
Ralph Lange (ralph-lange) wrote :

Hi Bruce,

Sorry if you were not aware of this:
Upmerging things 3.14 -> 3.15 -> 3.16 is directly done, manually, usually by Andrew, on a regular basis.
This makes sure we don't miss any patches, and keeps the amount of merge proposals manageable.
So - at least from the perspective of a feature author - waiting is usually enough to see the change appear on the newer branches.

(See also https://wiki-ext.aps.anl.gov/epics/index.php/How_to_check_out_EPICS_Base_with_Bazaar)

I only created a -3.14 branch and proposed it for merging, as the original branch (without the suffix) already existed, but had a different target.

Thus we will reject this merge proposal, and declare all remaining related branches abandoned, so they disappear from the top branch listing without being deleted.

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

OK, I'll wait to see how the 3.14 patch progresses.

Thanks for the link, that looks helpful.

Cheers,

- Bruce

On 10/13/2016 12:30 AM, Ralph Lange wrote:
> Review: Disapprove
>
> Hi Bruce,
>
> Sorry if you were not aware of this:
> Upmerging things 3.14 -> 3.15 -> 3.16 is directly done, manually, usually by Andrew, on a regular basis.
> This makes sure we don't miss any patches, and keeps the amount of merge proposals manageable.
> So - at least from the perspective of a feature author - waiting is usually enough to see the change appear on the newer branches.
>
> (See also https://wiki-ext.aps.anl.gov/epics/index.php/How_to_check_out_EPICS_Base_with_Bazaar)
>
> I only created a -3.14 branch and proposed it for merging, as the original branch (without the suffix) already existed, but had a different target.
>
> Thus we will reject this merge proposal, and declare all remaining related branches abandoned, so they disappear from the top branch listing without being deleted.
>

--
Bruce Hill
Member Technical Staff
SLAC National Accelerator Lab
2575 Sand Hill Road M/S 10
Menlo Park, CA 94025

Unmerged revisions

12741. By Bruce Hill

Implemented variable array sizing in pcas for 3.16

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/ca/legacy/pcas/generic/caHdrLargeArray.h'
2--- src/ca/legacy/pcas/generic/caHdrLargeArray.h 2016-05-22 03:43:09 +0000
3+++ src/ca/legacy/pcas/generic/caHdrLargeArray.h 2016-10-12 23:06:51 +0000
4@@ -30,7 +30,7 @@
5 # include "shareLib.h"
6 #endif
7
8-static const unsigned char CA_MINOR_PROTOCOL_REVISION = 12;
9+static const unsigned char CA_MINOR_PROTOCOL_REVISION = 13;
10
11 typedef ca_uint32_t caResId;
12
13
14=== modified file 'src/ca/legacy/pcas/generic/casStrmClient.cc'
15--- src/ca/legacy/pcas/generic/casStrmClient.cc 2014-05-30 17:36:50 +0000
16+++ src/ca/legacy/pcas/generic/casStrmClient.cc 2016-10-12 23:06:51 +0000
17@@ -388,7 +388,7 @@
18 //
19 // casStrmClient::verifyRequest()
20 //
21-caStatus casStrmClient::verifyRequest ( casChannelI * & pChan )
22+caStatus casStrmClient::verifyRequest ( casChannelI * & pChan, bool allowZeroCount )
23 {
24 const caHdrLargeArray * mp = this->ctx.getMsg();
25
26@@ -411,7 +411,8 @@
27 //
28 // element count out of range ?
29 //
30- if ( mp->m_count > pChan->getPVI().nativeCount() || mp->m_count == 0u ) {
31+ if ( mp->m_count > pChan->getPVI().nativeCount() ||
32+ ( !allowZeroCount && mp->m_count == 0u ) ) {
33 return ECA_BADCOUNT;
34 }
35
36@@ -444,7 +445,7 @@
37 casChannelI * pChan;
38
39 {
40- caStatus status = this->verifyRequest ( pChan );
41+ caStatus status = this->verifyRequest ( pChan, CA_V413 ( this->minor_version_number ) );
42 if ( status != ECA_NORMAL ) {
43 if ( pChan ) {
44 return this->sendErr ( guard, mp, pChan->getCID(),
45@@ -531,11 +532,15 @@
46 pChan->getCID(), status, ECA_GETFAIL );
47 }
48
49+ ca_uint32_t count = (msg.m_count == 0) ?
50+ (ca_uint32_t)desc.getDataSizeElements() :
51+ msg.m_count;
52+
53 void * pPayload;
54 {
55- unsigned payloadSize = dbr_size_n ( msg.m_dataType, msg.m_count );
56+ unsigned payloadSize = dbr_size_n ( msg.m_dataType, count );
57 caStatus localStatus = this->out.copyInHeader ( msg.m_cmmd, payloadSize,
58- msg.m_dataType, msg.m_count, pChan->getCID (),
59+ msg.m_dataType, count, pChan->getCID (),
60 msg.m_available, & pPayload );
61 if ( localStatus ) {
62 if ( localStatus==S_cas_hugeRequest ) {
63@@ -551,21 +556,21 @@
64 // (places the data in network format)
65 //
66 int mapDBRStatus = gddMapDbr[msg.m_dataType].conv_dbr(
67- pPayload, msg.m_count, desc, pChan->enumStringTable() );
68+ pPayload, count, desc, pChan->enumStringTable() );
69 if ( mapDBRStatus < 0 ) {
70 desc.dump ();
71 errPrintf ( S_cas_badBounds, __FILE__, __LINE__, "- get with PV=%s type=%u count=%u",
72- pChan->getPVI().getName(), msg.m_dataType, msg.m_count );
73+ pChan->getPVI().getName(), msg.m_dataType, count );
74 return this->sendErrWithEpicsStatus (
75 guard, & msg, pChan->getCID(), S_cas_badBounds, ECA_GETFAIL );
76 }
77 int cacStatus = caNetConvert (
78- msg.m_dataType, pPayload, pPayload, true, msg.m_count );
79+ msg.m_dataType, pPayload, pPayload, true, count );
80 if ( cacStatus != ECA_NORMAL ) {
81 return this->sendErrWithEpicsStatus (
82 guard, & msg, pChan->getCID(), S_cas_internal, cacStatus );
83 }
84- if ( msg.m_dataType == DBR_STRING && msg.m_count == 1u ) {
85+ if ( msg.m_dataType == DBR_STRING && count == 1u ) {
86 unsigned reducedPayloadSize = strlen ( static_cast < char * > ( pPayload ) ) + 1u;
87 this->out.commitMsg ( reducedPayloadSize );
88 }
89@@ -585,7 +590,7 @@
90 casChannelI * pChan;
91
92 {
93- caStatus status = this->verifyRequest ( pChan );
94+ caStatus status = this->verifyRequest ( pChan, CA_V413 ( this->minor_version_number ) );
95 if ( status != ECA_NORMAL ) {
96 return this->readNotifyFailureResponse ( guard, * mp, status );
97 }
98@@ -655,12 +660,16 @@
99 guard, msg, ECA_GETFAIL );
100 return ecaStatus;
101 }
102+
103+ ca_uint32_t count = (msg.m_count == 0) ?
104+ (ca_uint32_t)desc.getDataSizeElements() :
105+ msg.m_count;
106
107 void *pPayload;
108 {
109- unsigned size = dbr_size_n ( msg.m_dataType, msg.m_count );
110+ unsigned size = dbr_size_n ( msg.m_dataType, count );
111 caStatus status = this->out.copyInHeader ( msg.m_cmmd, size,
112- msg.m_dataType, msg.m_count, ECA_NORMAL,
113+ msg.m_dataType, count, ECA_NORMAL,
114 msg.m_available, & pPayload );
115 if ( status ) {
116 if ( status == S_cas_hugeRequest ) {
117@@ -675,23 +684,23 @@
118 // convert gdd to db_access type
119 //
120 int mapDBRStatus = gddMapDbr[msg.m_dataType].conv_dbr ( pPayload,
121- msg.m_count, desc, pChan->enumStringTable() );
122+ count, desc, pChan->enumStringTable() );
123 if ( mapDBRStatus < 0 ) {
124 desc.dump();
125 errPrintf ( S_cas_badBounds, __FILE__, __LINE__,
126 "- get notify with PV=%s type=%u count=%u",
127- pChan->getPVI().getName(), msg.m_dataType, msg.m_count );
128+ pChan->getPVI().getName(), msg.m_dataType, count );
129 return this->readNotifyFailureResponse ( guard, msg, ECA_NOCONVERT );
130 }
131
132 int cacStatus = caNetConvert (
133- msg.m_dataType, pPayload, pPayload, true, msg.m_count );
134+ msg.m_dataType, pPayload, pPayload, true, count );
135 if ( cacStatus != ECA_NORMAL ) {
136 return this->sendErrWithEpicsStatus (
137 guard, & msg, pChan->getCID(), S_cas_internal, cacStatus );
138 }
139
140- if ( msg.m_dataType == DBR_STRING && msg.m_count == 1u ) {
141+ if ( msg.m_dataType == DBR_STRING && count == 1u ) {
142 unsigned reducedPayloadSize = strlen ( static_cast < char * > ( pPayload ) ) + 1u;
143 this->out.commitMsg ( reducedPayloadSize );
144 }
145@@ -849,11 +858,15 @@
146 casChannelI & chan, const caHdrLargeArray & msg,
147 const gdd & desc, const caStatus completionStatus )
148 {
149+ ca_uint32_t count = (msg.m_count == 0) ?
150+ (ca_uint32_t)desc.getDataSizeElements() :
151+ msg.m_count;
152+
153 void * pPayload = 0;
154 {
155- ca_uint32_t size = dbr_size_n ( msg.m_dataType, msg.m_count );
156+ ca_uint32_t size = dbr_size_n ( msg.m_dataType, count );
157 caStatus status = out.copyInHeader ( msg.m_cmmd, size,
158- msg.m_dataType, msg.m_count, ECA_NORMAL,
159+ msg.m_dataType, count, ECA_NORMAL,
160 msg.m_available, & pPayload );
161 if ( status ) {
162 if ( status == S_cas_hugeRequest ) {
163@@ -871,7 +884,7 @@
164
165 gdd * pDBRDD = 0;
166 if ( completionStatus == S_cas_success ) {
167- caStatus status = createDBRDD ( msg.m_dataType, msg.m_count, pDBRDD );
168+ caStatus status = createDBRDD ( msg.m_dataType, count, pDBRDD );
169 if ( status != S_cas_success ) {
170 caStatus ecaStatus;
171 if ( status == S_cas_badType ) {
172@@ -892,7 +905,7 @@
173 pDBRDD->unreference ();
174 errPrintf ( S_cas_noConvert, __FILE__, __LINE__,
175 "no conversion between event app type=%d and DBR type=%d Element count=%d",
176- desc.applicationType (), msg.m_dataType, msg.m_count);
177+ desc.applicationType (), msg.m_dataType, count);
178 return monitorFailureResponse ( guard, msg, ECA_NOCONVERT );
179 }
180 }
181@@ -915,14 +928,14 @@
182 }
183
184 int mapDBRStatus = gddMapDbr[msg.m_dataType].conv_dbr (
185- pPayload, msg.m_count, *pDBRDD, chan.enumStringTable() );
186+ pPayload, count, *pDBRDD, chan.enumStringTable() );
187 if ( mapDBRStatus < 0 ) {
188 pDBRDD->unreference ();
189 return monitorFailureResponse ( guard, msg, ECA_NOCONVERT );
190 }
191
192 int cacStatus = caNetConvert (
193- msg.m_dataType, pPayload, pPayload, true, msg.m_count );
194+ msg.m_dataType, pPayload, pPayload, true, count );
195 if ( cacStatus != ECA_NORMAL ) {
196 pDBRDD->unreference ();
197 return this->sendErrWithEpicsStatus (
198@@ -932,7 +945,7 @@
199 //
200 // force string message size to be the true size
201 //
202- if ( msg.m_dataType == DBR_STRING && msg.m_count == 1u ) {
203+ if ( msg.m_dataType == DBR_STRING && count == 1u ) {
204 ca_uint32_t reducedPayloadSize = strlen ( static_cast < char * > ( pPayload ) ) + 1u;
205 this->out.commitMsg ( reducedPayloadSize );
206 }
207@@ -1940,7 +1953,7 @@
208
209 casChannelI *pciu;
210 {
211- caStatus status = casStrmClient::verifyRequest ( pciu );
212+ caStatus status = casStrmClient::verifyRequest ( pciu, CA_V413 ( this->minor_version_number ) );
213 if ( status != ECA_NORMAL ) {
214 if ( pciu ) {
215 return this->sendErr ( guard, mp,
216
217=== modified file 'src/ca/legacy/pcas/generic/casStrmClient.h'
218--- src/ca/legacy/pcas/generic/casStrmClient.h 2010-08-10 21:05:46 +0000
219+++ src/ca/legacy/pcas/generic/casStrmClient.h 2016-10-12 23:06:51 +0000
220@@ -69,7 +69,7 @@
221 bool responseIsPending;
222
223 caStatus createChannel ( const char * pName );
224- caStatus verifyRequest ( casChannelI * & pChan );
225+ caStatus verifyRequest ( casChannelI * & pChan, bool allowZeroCount = false );
226 typedef caStatus ( casStrmClient :: * pCASMsgHandler )
227 ( epicsGuard < casClientMutex > & );
228 static pCASMsgHandler const msgHandlers[CA_PROTO_LAST_CMMD+1u];

Subscribers

People subscribed via source and target branches