Add support for sendfile() based DATA frames.
還沒有人認領這個 Issue。
評估
- 難度
- 5/5
- 預估耗時
- 一週以上
- 新手友好度
- 25/100
- Issue 類型
- 功能
- 描述清晰度
- 需要釐清
- 活躍度
- 停滯
- 技術堆疊
- python
- 領域
- api, networking
研究方向
首先檢查 H2Connection、data_to_send() 和 receive_data(),issue 將它們識別為受影響的 API 端點。比較提議的 buffering、iterable-sentinel、wrapper 和 API-break 方案;當 contributors 就支援基於 sendfile 的 DATA frames 的設計達成共識時,工作即完成。
由索引模型根據 Issue 內容生成。
描述
Right now there is no support for HTTP/2 using sendfile to send DATA frames. This is potentially inefficient for implementations that are able to send really sizeable DATA frames. Given that sendfile allows users to send fixed length data, it would be nice to provide some way to say "send these bytes, then do a sendfile with this fobj and this length".
@njsmith's h11 library has this capacity, but this relies on the fact that h11 has no internal buffer: each "event" call returns the bytes required for that event directly without writing into a buffer. This allows for the subtle changing of return value in comparison to send, which is not so naturally achievable with h2.
Coming up with a good design here is a bit tricky. It may be that this should be an optional switch on the H2Connection class that affects the return value of data_to_send(), changing it to be an iterable of bytes and sentinel objects where each sentinel object is . Alternatively, we could go further and say that not only does the optional switch need to be enabled but there is also a separate "get the data I need" function that conforms to this new API.
Another possible option that leaps out to me is to have a subclass (eww) or some other type that implements this support as a wrapper around the base H2Connection object.
The final possible option is a dramatic API change. That changes the signature of receive_data to return two values: the events iterable and any bytes that may need to be sent. If we do that, we can then remove hyper-h2's internal buffer and then delegate entirely to the calling code by having all do_event() type functions simply return the data they generate rather than storing it internally. That's a very large API break, but it allows supporting this use-case more cleanly by simply emulating what h11 does.
I'd like opinions from @python-hyper/contributors. Any thoughts on API choices? Is this worth supporting at all?
- 主要語言
- Python
- 星號
- 1k
- 分支
- 197
- PR 合併指標
- 30 天內沒有已合併 PR
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
python-hyper/h2 的其他 Issue
-
難度 4/5 3-5 天 新手友好度 45/100
python-hyper/h2#1330 ·
-
content-length is not policed when a stream ends with a trailers section可能已有人在做 @feiiiiii5 於 31 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 76/100
python-hyper/h2#1328 ·
-
難度 5/5 一週以上 新手友好度 35/100
python-hyper/h2#1312 ·
-
難度 4/5 3-5 天 新手友好度 35/100
python-hyper/h2#1280 · 2 則留言 ·
-
難度 3/5 1-2 天 新手友好度 45/100
python-hyper/h2#1239 · 3 個 reaction ·
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 67/100
維護者通常 2 天內回覆
-
難度 2/5 1-3 小時 新手友好度 68/100
letsencrypt/cp-cps#361 ·
-
難度 2/5 1-3 小時 新手友好度 65/100
-
CI: startup_failure because callers grant fewer permissions than ledger-app-workflows@v1 declares可能已有人在做 @maykonmichel 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 76/100
LedgerHQ/app-boilerplate-rust#227 ·
-
難度 2/5 1-3 小時 新手友好度 76/100
linuxmint/mintupdate#1107 ·