Conversation
|
I added a new The interface is as follows: class HttpParser {
void feed_data(const char* buf, size_t n);
size_t slurp_data(char* buf, size_t n);
};The basic idea is to "feed" all data we receive from sockets to the parser, once enough data has been "fed" to the parser, we can retreive either a full The parser will also be able to decode chunked encoding in the future, this is why all data must pass through it. When we need to, we can retreive data from the parser with the function I added some basic unit tests for request line parsing, like this: The main logic has alson been changed quite a bit. I will clean it up later or maybe add comments to explain in more detail. |
|
Webserver crashes when running and you visit http://localhost:8080 |
StokesAsselborn
left a comment
There was a problem hiding this comment.
As discussed, the router needs to be fixed in order to test this PR.
The overall logic of the parser looks ok. Refinement can be done later.
3fe7c5d to
2de7f06
Compare
|
Merging, I think this is good for now.. |
Closes #10, closes #18, closes #20
Lot of work here, trying to do the right thing