This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch 8.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/8.1.x by this push:
     new df3a981  Fix HPACK Dynamic Table Cleanup
df3a981 is described below

commit df3a981a662669004569bfb7a267c24f064ed8c7
Author: Masaori Koshiba <masa...@apache.org>
AuthorDate: Mon May 11 08:56:54 2020 +0900

    Fix HPACK Dynamic Table Cleanup
    
    (cherry picked from commit 3376d438b4a6410187e1ddedd87d2e89279ec196)
    
     Conflicts:
        proxy/http2/unit_tests/test_HpackIndexingTable.cc
---
 proxy/http2/HPACK.cc | 22 +++++++---------------
 proxy/http2/HPACK.h  |  6 +++---
 2 files changed, 10 insertions(+), 18 deletions(-)

diff --git a/proxy/http2/HPACK.cc b/proxy/http2/HPACK.cc
index eefdef2..97a2626 100644
--- a/proxy/http2/HPACK.cc
+++ b/proxy/http2/HPACK.cc
@@ -327,10 +327,10 @@ HpackIndexingTable::size() const
   return _dynamic_table->size();
 }
 
-bool
+void
 HpackIndexingTable::update_maximum_size(uint32_t new_size)
 {
-  return _dynamic_table->update_maximum_size(new_size);
+  _dynamic_table->update_maximum_size(new_size);
 }
 
 //
@@ -403,11 +403,11 @@ HpackDynamicTable::size() const
 // are evicted from the end of the header table until the size of the
 // header table is less than or equal to the maximum size.
 //
-bool
+void
 HpackDynamicTable::update_maximum_size(uint32_t new_size)
 {
   this->_maximum_size = new_size;
-  return this->_evict_overflowed_entries();
+  this->_evict_overflowed_entries();
 }
 
 uint32_t
@@ -416,12 +416,12 @@ HpackDynamicTable::length() const
   return this->_headers.size();
 }
 
-bool
+void
 HpackDynamicTable::_evict_overflowed_entries()
 {
   if (this->_current_size <= this->_maximum_size) {
     // Do nothing
-    return true;
+    return;
   }
 
   for (auto h = this->_headers.rbegin(); h != this->_headers.rend(); ++h) {
@@ -438,13 +438,7 @@ HpackDynamicTable::_evict_overflowed_entries()
     }
   }
 
-  if (this->_headers.size() == 0) {
-    return false;
-  }
-
   this->_mime_hdr_gc();
-
-  return true;
 }
 
 /**
@@ -774,9 +768,7 @@ update_dynamic_table_size(const uint8_t *buf_start, const 
uint8_t *buf_end, Hpac
     return HPACK_ERROR_COMPRESSION_ERROR;
   }
 
-  if (indexing_table.update_maximum_size(size) == false) {
-    return HPACK_ERROR_COMPRESSION_ERROR;
-  }
+  indexing_table.update_maximum_size(size);
 
   return len;
 }
diff --git a/proxy/http2/HPACK.h b/proxy/http2/HPACK.h
index 34d1f6d..e38ccb7 100644
--- a/proxy/http2/HPACK.h
+++ b/proxy/http2/HPACK.h
@@ -119,12 +119,12 @@ public:
 
   uint32_t maximum_size() const;
   uint32_t size() const;
-  bool update_maximum_size(uint32_t new_size);
+  void update_maximum_size(uint32_t new_size);
 
   uint32_t length() const;
 
 private:
-  bool _evict_overflowed_entries();
+  void _evict_overflowed_entries();
   void _mime_hdr_gc();
 
   uint32_t _current_size = 0;
@@ -148,7 +148,7 @@ public:
   void add_header_field(const MIMEField *field);
   uint32_t maximum_size() const;
   uint32_t size() const;
-  bool update_maximum_size(uint32_t new_size);
+  void update_maximum_size(uint32_t new_size);
 
 private:
   HpackDynamicTable *_dynamic_table;

Reply via email to