Block attempts to put more bytes than will fit.
This commit is contained in:
@@ -12,6 +12,11 @@
|
||||
<h2 align="center">Changes between 3.14.10 and 3.14.11</h2>
|
||||
<!-- Insert new items below here ... -->
|
||||
|
||||
<h4>epicsRingBytes</h4>
|
||||
|
||||
<p>Partial puts are not supported. An attempt to put more bytes than currently free will be rejected.</p>
|
||||
|
||||
<h4>camonitor timestamp support</h4>
|
||||
<h4>Long string support</h4>
|
||||
|
||||
<p>The IOC now provides support for strings longer than 40 characters through
|
||||
|
||||
@@ -105,7 +105,7 @@ epicsShareFunc int epicsShareAPI epicsRingBytesPut(
|
||||
if (nextPut < nextGet) {
|
||||
freeCount = nextGet - nextPut - SLOP;
|
||||
if (nbytes > freeCount)
|
||||
nbytes = freeCount;
|
||||
return 0;
|
||||
if (nbytes)
|
||||
memcpy ((void *)&pring->buffer[nextPut], value, nbytes);
|
||||
nextPut += nbytes;
|
||||
@@ -113,7 +113,7 @@ epicsShareFunc int epicsShareAPI epicsRingBytesPut(
|
||||
else {
|
||||
freeCount = size - nextPut + nextGet - SLOP;
|
||||
if (nbytes > freeCount)
|
||||
nbytes = freeCount;
|
||||
return 0;
|
||||
topCount = size - nextPut;
|
||||
copyCount = (nbytes > topCount) ? topCount : nbytes;
|
||||
if (copyCount)
|
||||
@@ -134,8 +134,7 @@ epicsShareFunc void epicsShareAPI epicsRingBytesFlush(epicsRingBytesId id)
|
||||
{
|
||||
ringPvt *pring = (ringPvt *)id;
|
||||
|
||||
pring->nextGet = 0;
|
||||
pring->nextPut = 0;
|
||||
pring->nextGet = pring->nextPut;
|
||||
}
|
||||
|
||||
epicsShareFunc int epicsShareAPI epicsRingBytesFreeBytes(epicsRingBytesId id)
|
||||
|
||||
Reference in New Issue
Block a user