u413-284-si / webserv

This project is about setting up a http web server, providing a static website.
MIT License
0 stars 0 forks source link

Receive and send big files #52

Open gwolf-011235 opened 3 weeks ago

gwolf-011235 commented 3 weeks ago

Right now we store the full request (header and body) and full response (header and body) in an std::string.

With big files (e.g. 2GB) this is a problem:

  1. if we want to receive a big file the buffer won't hold the full thing
  2. likewise if we want to send a big file - buffer won't hold it.

Possible solutions:

  1. save the body as a temp file.
  2. don't cache the body of the response in the buffer. Just open it and send directly.