bryancall commented on code in PR #11657:
URL: https://github.com/apache/trafficserver/pull/11657#discussion_r1706063606
##########
src/proxy/hdrs/XPACK.cc:
##########
@@ -501,25 +501,28 @@ XpackDynamicTable::_make_space(uint64_t
extra_space_needed)
return extra_space_needed == 0;
}
uint32_t freed = 0;
- uint32_t tail = this->_calc_index(this->_entries_tail, 1);
+ uint32_t tail = this->_entries_tail;
while (extra_space_needed > freed) {
- if (this->_entries_head < tail) {
- break;
- }
+ tail = this->_calc_index(tail, 1); // Move to the next entry
+
if (this->_entries[tail].ref_count) {
break;
}
freed += this->_entries[tail].name_len + this->_entries[tail].value_len +
ADDITIONAL_32_BYTES;
- tail = this->_calc_index(tail, 1);
+ if (this->_entries_head == tail) {
Review Comment:
It looks like changing the result on an empty table is better since that is
what we are expecting in `insert_entry()` and `update_maximum()` size we check
to see if the table is not empty already.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]