# std: more reliable HTTP and TLS networking · gitcafe/zig

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

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

Visibility: public

Requested revision: a0f9a5e78d1cf419e88c493f6f57e486df236e35

Requested commit: a0f9a5e78d1cf419e88c493f6f57e486df236e35

Commit: a0f9a5e78d1cf419e88c493f6f57e486df236e35

Tree: b91fc5370cf921491e50da075e0d3bc609da6a73

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
std: more reliable HTTP and TLS networking

* std.Io.Reader: fix confused semantics of rebase. Before it was
  ambiguous whether it was supposed to be based on end or seek. Now it
  is clearly based on seek, with an added assertion for clarity.

* std.crypto.tls.Client: fix panic due to not enough buffer size
  available. Also, avoid unnecessary rebasing.

* std.http.Reader: introduce max_head_len to limit HTTP header length.
  This prevents crash in underlying reader which may require a minimum
  buffer length.

* std.http.Client: choose better buffer sizes for streams and TLS
  client. Crucially, the buffer shared by HTTP reader and TLS client
  needs to be big enough for all http headers *and* the max TLS record
  size. Bump HTTP header size default from 4K to 8K.

fixes #24872

I have noticed however that there are still fetch problems

```

## Parents

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

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