Repository navigation
fix(http): build natively again with the cookie jar - #242
Merged
Merged
Conversation
A program that imported http 0.22.0.0 failed bend -o with an arity over 247 (bendlang/bend#1069). Cav held two Maybe<Time.Instant> fields, and each Instant flattens to 65 words, so cookie.av.put held too many live words. Cav now keeps Expires as the date sent and Max-Age as seconds; cookie.make turns them into times from now. Fixes #241
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A program that imports
bend-kit-httpbuilds natively again. With0.22.0.0,bend app.bend -o appfailed withError: an arity over 247even for a program that only callsHttp.get;0.21.1.0built.Cause
Time.Instantholds anInt.I64, aWord(64n), which the C backend flattens to 64 one-word cells. The cookie parser'sCavrecord held twoMaybe<Time.Instant>fields, andcookie.av.putkept aCav,now, and a new time live together, past the 247-word segment limit (bendlang/bend#1069).fetchreaches the cookie parser through the redirect loop, so every client program hit it.Cavnow keepsExpiresas the date sent andMax-Ageas capped seconds.cookie.maketurns them into times fromnow. The jar behaves as before: Max-Age still wins over Expires, and both are still capped at 400 days.The changed helpers (
Cav,cookie.max_age,cookie.av.put,cookie.av,cookie.avs,cookie.make) are internal, but every def is public, so the version goes to0.23.0.0.Validation
Http.getbuilds natively against thishttp.bend; against0.22.0.0it fails with the arity error.bend PROOF.bend: all terms check, including the cookie laws.bend check.bend: every line ok, including the live cookie-jar checks.Fixes #241