mirror of
https://github.com/curl/curl.git
synced 2026-08-25 05:13:31 +03:00
altsvc: cap the list at 5,000 entries
Avoid never-ending growth. When adding more entries, it now deletes the first entry in the list, which is the oldest added entry still held in memory. I decided to avoid a Least Recently Used concept as I suspect with a list with this many entries most entries have not been used, and we don't save the timestamp of recent use anyway. The net effect might (no matter what) be that the removed entry might feel a bit "random" in the eyes of the user. Verify with test 1669. Reported-by: Geeknik Labs Fixes #21183 Closes #21189
This commit is contained in:
parent
c1963e2d2c
commit
0805ec043e
6 changed files with 118 additions and 7 deletions
37
tests/data/test1669
Normal file
37
tests/data/test1669
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="US-ASCII"?>
|
||||
<testcase>
|
||||
<info>
|
||||
<keywords>
|
||||
unittest
|
||||
Alt-Svc
|
||||
</keywords>
|
||||
</info>
|
||||
|
||||
<client>
|
||||
<features>
|
||||
unittest
|
||||
alt-svc
|
||||
</features>
|
||||
|
||||
# This date is exactly "20190124 22:34:21" UTC
|
||||
<setenv>
|
||||
CURL_TIME=1548369261
|
||||
</setenv>
|
||||
<name>
|
||||
alt-svc load cache with >5000 entries
|
||||
</name>
|
||||
<command>
|
||||
%LOGDIR/%TESTNUMBER
|
||||
</command>
|
||||
<file name="%LOGDIR/%TESTNUMBER" mode="text">
|
||||
%repeat[5010 x h2 example.com 443 h3 shiny.example.com 8443 "20191231 00:00:00" 0 0%0a]%
|
||||
</file>
|
||||
</client>
|
||||
|
||||
<verify>
|
||||
<limits>
|
||||
Allocations: 5100
|
||||
Maximum allocated: 600000
|
||||
</limits>
|
||||
</verify>
|
||||
</testcase>
|
||||
Loading…
Add table
Add a link
Reference in a new issue