Skip to content

Commit

Permalink
none
Browse files Browse the repository at this point in the history
  • Loading branch information
chrishtr committed Dec 27, 2024
1 parent e0fa7a3 commit 148f176
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions book/http.md
Original file line number Diff line number Diff line change
Expand Up @@ -988,8 +988,10 @@ the `Connection: close` header (send `Connection: keep-alive` instead).
When reading the body from the socket, only read as many bytes as given
in the `Content-Length` header and don't close the socket afterward.
Instead, save the socket, and if another request is made to the same server
reuse the same socket instead of creating a new one. This will speed up repeated
requests to the same server, which are common.
reuse the same socket instead of creating a new one.
(You'll also need to pass the `"rb"` option to `makefile` or the value reported
by `Content-Length` might not match the length of the string you're reading.)
This will speed up repeated requests to the same server, which are common.

1-7 *Redirects*. Error codes in the 300 range request a redirect. When
your browser encounters one, it should make a new request to the URL
Expand Down

0 comments on commit 148f176

Please sign in to comment.