Skip to content

Commit ffe29d0

Browse files
wiechulashahor02
authored andcommitted
Fix RawParser: set proper size estimate for payload
So far the fixed page size has been used to calculate the size of the payload, simply because of the lack of information at the time of implmenting the parser. The variable size of the payload is stored in the member memorySize in both RDH v4 and v5. Since the raw parser does only supports those two versions at the moment, the fix can be applied as it is. there is no need to support RDH v2 which has a member blockLength.
1 parent 011c75e commit ffe29d0

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

Framework/Utils/include/DPLUtils/RawParser.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,7 @@ class ConcreteRawParser
117117
return 0;
118118
}
119119
header_type const& h = header();
120-
// FIXME: block length disappeared in V5, check what can be used
121-
return max_size - h.headerSize;
120+
return h.memorySize - h.headerSize;
122121
}
123122

124123
/// Get pointer to payload data at current position

Framework/Utils/test/test_RawParser.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ BOOST_AUTO_TEST_CASE(test_RawParser)
3030
rdh->version = 5;
3131
rdh->headerSize = sizeof(V5);
3232
rdh->offsetToNext = PageSize;
33+
rdh->memorySize = PageSize;
3334
rdh->pageCnt = NofPages;
3435
rdh->packetCounter = pageNo;
3536
rdh->stop = pageNo + 1 == NofPages;

0 commit comments

Comments
 (0)