Skip to content

Conversation

cee-dub
Copy link
Collaborator

@cee-dub cee-dub commented Sep 11, 2025

Eases interaction with the platform, which imposes limits elsewhere.

@cee-dub cee-dub force-pushed the cee-dub/limitless-headers branch 2 times, most recently from 930b72a to 83d5baa Compare September 12, 2025 00:25
@cee-dub cee-dub requested a review from Copilot September 12, 2025 05:37
Copy link

@Copilot Copilot AI left a comment

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 deprecates remaining buffer size limits and makes all buffers adaptive to ease interaction with the platform. The key changes include refactoring buffer management to automatically resize when encountering BufLen errors and deprecating fixed-size limit APIs.

  • Introduced adaptive buffer handling that automatically resizes when buffer capacity is exceeded
  • Removed fixed buffer size parameters from HTTP header and method APIs
  • Deprecated limit-related APIs in favor of adaptive buffer sizing

Reviewed Changes

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

Show a summary per file
File Description
internal/abi/fastly/adaptivebuf.go New helper function for adaptive buffer management
internal/abi/fastly/types.go Refactored Values iterator to use adaptive buffering
fsthttp/limits.go Deprecated Limits struct and related methods
Multiple guest.go files Replaced fixed-size buffers with adaptive buffer calls
Multiple other files Updated method signatures to remove buffer size parameters

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@cee-dub cee-dub force-pushed the cee-dub/limitless-headers branch from 83d5baa to 6685e83 Compare September 12, 2025 16:22
@cee-dub cee-dub merged commit 080630c into main Sep 12, 2025
10 checks passed
@cee-dub cee-dub deleted the cee-dub/limitless-headers branch September 12, 2025 18:44
log_debug "Checking port with /dev/tcp/${host}/${port}"
fi

(true &>/dev/null <>/dev/tcp/${host}/${port})
Copy link
Member

Choose a reason for hiding this comment

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

Do we want this to run on macOS? This is only going to work on Linux.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It actually works fine on my Mac AFAICT. This /dev is a bash built-in.

Copy link
Member

Choose a reason for hiding this comment

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

ah! ok, neat! did not know about that.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I just learned about it, too. Will add a comment to explain.

// Deprecated: the limit is not enforced, buffer sizing is adaptive.
func (limits *Limits) MaxHeaderNameLen() int {
return limits.maxHeaderNameLen
return math.MaxInt
Copy link
Member

Choose a reason for hiding this comment

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

I think we should continue to return the same default values as before -- this is what the Rust SDK did when these were marked deprecated. If not that, then we should probably make this a more realistic value. See https://docs.fastly.com/products/network-services-resource-limits#request-and-response-limits for the actual platform limits.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, will do.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update headers hostcalls to adaptive buffers and deprecate remaining limits APIs
3 participants