Skip to content

Commit

Permalink
add zero-copy send todo
Browse files Browse the repository at this point in the history
  • Loading branch information
Archmonger committed Feb 10, 2022
1 parent 35b9003 commit 8eef8d3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions whitenoise/asgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ async def serve_static_file(send, static_file, method, request_headers, block_si
# the difference is important when serving range requests.
content_length = int(dict(response.headers)["Content-Length"])
for block in read_file(response.file, content_length, block_size):
# TODO: Wait for ASGI webservers to support zero-copy send
# See https://asgi.readthedocs.io/en/latest/extensions.html#zero-copy-send
await send(
{"type": "http.response.body", "body": block, "more_body": True}
)
Expand Down

0 comments on commit 8eef8d3

Please sign in to comment.