Skip to content

altsvc: accept ma/persist per alternative entry - #20160

Closed
bagder wants to merge 6 commits into
masterfrom
bagder/alt-svc-parser
Closed

altsvc: accept ma/persist per alternative entry#20160
bagder wants to merge 6 commits into
masterfrom
bagder/alt-svc-parser

Conversation

@bagder

@bagder bagder commented Jan 2, 2026

Copy link
Copy Markdown
Member

The 'ma' and 'persist' keywords should be considered per list entry, not once per header.

Expand test 1654 to verify such headers

Reported-by: Hunt Darlener

The 'ma' and 'persist' keywords should be considered per list entry, not
once per header.

Expand test 1654 to verify such headers

Reported-by: Hunt Darlener
@github-actions github-actions Bot added the tests label Jan 2, 2026
@bagder
bagder requested a review from Copilot January 2, 2026 10:21
@bagder
bagder marked this pull request as ready for review January 2, 2026 10:21

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

This PR fixes the Alt-Svc header parsing to correctly handle 'ma' (max-age) and 'persist' parameters on a per-entry basis rather than globally per header. Previously, these parameters would apply to all alternative service entries in a header; now each entry can have its own values.

Key changes:

  • Moved maxage and persist variable initialization into the per-entry parsing loop
  • Moved the ma/persist parameter parsing from header level to entry level
  • Updated test to verify per-entry ma values are correctly applied

Reviewed changes

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

File Description
lib/altsvc.c Refactored parsing logic to initialize and parse ma/persist parameters per alternative service entry instead of once per header
tests/unit/unit1654.c Modified existing test case to include per-entry ma values and added new test case to verify different ma values for different entries
tests/data/test1654 Added expected output entries for the new test case with correct expiration times

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

Comment thread lib/altsvc.c Outdated
Comment thread tests/unit/unit1654.c Outdated
@bagder

bagder commented Jan 2, 2026

Copy link
Copy Markdown
Member Author

augment review

@augmentcode

augmentcode Bot commented Jan 2, 2026

Copy link
Copy Markdown
🤖 Augment PR Summary

Summary: Adjust Alt-Svc parsing so ma (max-age) and persist are applied per alternative entry, rather than once per header.

Changes:

  • Move maxage/persist defaults into the per-entry parse loop in Curl_altsvc_parse()
  • Parse optional ma/persist parameters immediately after each entry’s quoted authority
  • Expand unit test 1654 (and its expected output) to verify mixed per-entry ma values and unknown parameters

🤖 Was this summary useful? React with 👍 or 👎

@augmentcode augmentcode Bot 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.

Review completed. 1 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread lib/altsvc.c

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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.


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

Comment thread lib/altsvc.c
@bagder

bagder commented Jan 2, 2026

Copy link
Copy Markdown
Member Author

augment review

@augmentcode augmentcode Bot 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.

Review completed. 1 suggestions posted.

Fix All in Augment

Comment augment review to trigger a new review at any time.

Comment thread lib/altsvc.c
@bagder bagder closed this in 03c9215 Jan 2, 2026
@bagder
bagder deleted the bagder/alt-svc-parser branch January 2, 2026 22:50
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