bryancall commented on code in PR #11657:
URL: https://github.com/apache/trafficserver/pull/11657#discussion_r1706054570


##########
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:
   This however now changes the result code when the table is empty.  Before it 
would return true if the table was empty and now it will return false.   I have 
to look to see if this will cause and issue.  It does pass the unit test either 
way, which is worrisome. 



-- 
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]

Reply via email to