Answer the question
In order to leave comments, you need to log in
How to properly process HTTP requests?
I am trying to make a simple http server.
At the moment parsing the http request looks like this.
- I read the first line and parse it.
- I read the following lines until "\r\n" is followed by "\r\n"
- if content length != 0 I write to the buffer.
The question is, if I want to limit the size of the body or not read the request body at all, what should I do?
One thought comes to mind - as soon as I read the headers, send the Request further, and then if the application requires to save the body or not.
In short, I want to make a simple library for building http servers.
If it matters then I use C.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question