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

Use a string for storing the content of the config file #53

Open QCHR1581 opened 3 weeks ago

QCHR1581 commented 3 weeks ago

Instead of opening the config file and read it line by line, the content of the file will be stored in a string

This approach is important for two topics:

  1. Make it easier reading the content of the config file multiple times (#54)

  2. Handle values which are not on the same line as the corresponding directive (#55)

gwolf-011235 commented 1 day ago

Note: when fork-execing (for cgi) the destructor of ConfigFileParser() and std::ifstream() never get called. Currently this would leave the configfile open.

After storing configfile content in string, the file should be closed. Either by explicit .close() or having the std::ifstream() not as member but only local variable.