alcjzk / Webserv

0 stars 0 forks source link

Request handling improvements #58

Closed alcjzk closed 6 months ago

alcjzk commented 6 months ago

Main changes


Connection

The class' main purpose is to carry any state that needs to live for the full duration of the connection. This includes the following:

        File                  _client;
        const Server&         _server;
        bool                  _keep_alive = true;
        std::optional<Reader> _reader = std::nullopt;

Value for _reader will retain any reader (readbuffer) state that needs to persist beyond a single request. This fixes issues when a single recv call reads more than one request into the buffer.

All of these values have also been so far passed separately into basically all tasks, so the refactor to use this as replacement is quite large.


Other changes

Not in this PR

Some todo items will be handled outside this PR, due to the large refactor.

  • 59

  • 60