Skip to content

alt-svc: skip expired entries read from file - #21187

Closed
bagder wants to merge 1 commit into
masterfrom
bagder/altsvc-expired
Closed

bagder wants to merge 1 commit into
masterfrom
bagder/altsvc-expired

Conversation

@bagder

@bagder bagder commented Apr 1, 2026

Copy link
Copy Markdown
Member

Extend test 1654 to verify

@bagder
bagder requested a review from Copilot April 1, 2026 07:17
@github-actions github-actions Bot added the tests label Apr 1, 2026
@bagder
bagder marked this pull request as ready for review April 1, 2026 07:18

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates Alt-Svc cache handling to ignore expired entries when loading from disk, and extends an existing unit test to validate that behavior.

Changes:

  • Skip adding Alt-Svc cache entries from file when their parsed expiry timestamp is already in the past.
  • Move/enable the debug/unit-test time override earlier in lib/altsvc.c so the new expiry check uses the deterministic CURL_TIME.
  • Extend test 1654 input to include an expired entry and adjust other timestamps to ensure the test remains stable.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
tests/data/test1654 Adds an expired Alt-Svc line and updates dates so the output verifies that expired entries are skipped under fixed CURL_TIME.
lib/altsvc.c Skips expired entries during file load (altsvc_add) and ensures time() override is active for debug/unit-test builds.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@bagder bagder closed this in 11609c3 Apr 1, 2026
@bagder
bagder deleted the bagder/altsvc-expired branch April 1, 2026 08:56
outcast36 pushed a commit to greearb/curl that referenced this pull request Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants