# http: fix handling of limit in chunkedSendFile · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/4f639ff8805b33fa6c75416eddfb205e3a04e09a)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 4f639ff8805b33fa6c75416eddfb205e3a04e09a

Requested commit: 4f639ff8805b33fa6c75416eddfb205e3a04e09a

Commit: 4f639ff8805b33fa6c75416eddfb205e3a04e09a

Tree: 8ac225b01276c0dfa2d513b4aaa3b4fc99d1f665

Author: Kendall Condon

Committer: Andrew Kelley

## Message

```
http: fix handling of limit in chunkedSendFile

`limit` in chunkedSendFile applies only to the file, not the entire
chunk. `limit` in sendFileHeader does not include the header.

Additionally adds a comment to clarify what `limit` applies to in
sendFileHeader and fixed a small bug in it (`drain` is able to return
less then `header.len`).

```

## Parents

- [5e986fef1fa5cf04f3547cc4f5a8c0f490ea1d3d](https://git.cafe/gitcafe/zig/commit/5e986fef1fa5cf04f3547cc4f5a8c0f490ea1d3d?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/4f639ff8805b33fa6c75416eddfb205e3a04e09a?format=markdown)
