Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add offset and count to Path Send #469

Open
Archmonger opened this issue Sep 25, 2024 · 2 comments
Open

Add offset and count to Path Send #469

Archmonger opened this issue Sep 25, 2024 · 2 comments

Comments

@Archmonger
Copy link

This discussion exists to talk about whether the Path Send spec can be reasonably modified to support offset and count, in a similar manner to those respective variables within zerocopysend.

As a summary of the original discussion...

  • zerocopysend was effectively dead on arrival due to integration challenges with existing webservers.
  • pathsend can be considered as an alternative that is more compatible with a variety of webservers.
  • pathsend currently does not support offset and count, which makes it impossible to use with HTTP range requests.
  • andrewgodwin agreed that offset and count can be added to pathsend if it can be implemented in a backwards compatible manner
  • I suggested if backwards compatibility is too challenging, then the extension namespace can be cluttered with http.response.pathsend2
@gi0baro
Copy link
Contributor

gi0baro commented Sep 25, 2024

On the backward compatibility thing, I personally think is fine to add new features on top of an existing extension, given there's a way for the application to understand if those features are supported.

One idea might be to add this information to the scope, eg:

"scope": {
    "extensions": {
        "http.response.pathsend": {
            "ranges": True
        },
    },
}

in such way the application knows if the server supports the additional keys in the messages and use them; the lack of that boolean means no support is given. I'd also personally prefer a single key in the message for the range, as the application should already know the total size of the file to produce valid range headers, eg:

{
    "type": "http.response.pathsend",
    "path": "foobar.txt",
    "range": (0, 4096)   # send only the first 4KB
}

@andrewgodwin
Copy link
Member

That's a good idea - extensions entries were meant to be dicts exactly so we could definitely add signal in there.

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

No branches or pull requests

3 participants