Lesson 3.1
One data event is not one request
What TCP actually guarantees about a read, why curl hides the problem, and the accumulator-plus-cursor rewrite that lets your parser resume where a read left off instead of dropping the fragment.
What you will build
- State exactly what TCP guarantees about a read, and the three things a 'data' chunk can be.
- Explain why rescanning the accumulated buffer from byte 0 on every read is O(N^2), and how a forward cursor makes it O(N).
- Make the parser resumable through the header block terminator so a request split at any byte parses identically to one delivered whole.