If the size of the new entry is less than or equal to the maximum size, that entry is added to the table. It is not an error to attempt to add an entry that is larger than the maximum size; an attempt to add an entry larger than the maximum size causes the table to be emptied of all existing entries and results in an empty table.
If the EntrySize itself larger than the max_size in state, the cow_hpack:table_insert/2 will still return a state with this entry in the dyn_table, it should return the state with empty dyn_table if the EntrySize > MaxSize.
According to RFC7541 4.4:
If the EntrySize itself larger than the
max_size
in state, thecow_hpack:table_insert/2
will still return a state with this entry in thedyn_table
, it should return the state with emptydyn_table
if theEntrySize > MaxSize
.