Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs from last night #1

Merged
merged 1 commit into from
Aug 28, 2024
Merged

Fix bugs from last night #1

merged 1 commit into from
Aug 28, 2024

Conversation

adamchalmers
Copy link
Owner

Wrote two bugs last night:

  1. The HTTP spec says that if the client sends Expect: 100-continue, the server should send a preliminary status HTTP/1.1 100 Continue response back, then wait for the client to send the body, then the server sends the real HTTP status (e.g. 200 OK) with headers + body. Our implementation didn't send the real HTTP status back, it skipped straight to sending the response headers + body.
  2. Used max instead of min when trying to limit how many bytes the server would write at once.

Also, I investigated OS Error 22 more. I used strace to figure out which system call was causing an error (it was write) then looked up its manpage with man 2 write. It says it can only handle INT_MAX bytes in a single write, and it won't do a partial write if you write more than that, it'll just fail. On my platform, INT_MAX is (2^31) so we limit to that.

@adamchalmers adamchalmers merged commit dcf8810 into main Aug 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant