Wip chunked decoding

+ Need to test normal body parsing
+ path_is_valid() renamed eval_file_type()
+ replaced atoi with strtol/strtoul
This commit is contained in:
LuckyLaszlo
2022-08-12 05:50:00 +02:00
parent ab0bc2c4c0
commit 400efbe720
18 changed files with 185 additions and 82 deletions

View File

@@ -1,7 +1,6 @@
#include "Webserv.hpp"
// TODO : path_is_valid() Macro for return value
void Webserv::_get(Client *client)
{
std::string path = client->get_rq_abs_path();
@@ -30,14 +29,14 @@ void Webserv::_get(Client *client)
// END TMP HUGO
// Index/Autoindex block
if (path_is_valid(path) == IS_DIR)
if (eval_file_type(path) == IS_DIR)
{
std::cout << "made it to Index/Autoindex\n";
if (path[path.size() - 1] != '/')
path.push_back('/');
for (size_t i = 0; i < client->assigned_location->index.size(); i++)
{
if (path_is_valid(path + client->assigned_location->index[i]) == 2)
if (eval_file_type(path + client->assigned_location->index[i]) == IS_FILE)
{
path.append(client->assigned_location->index[i]);
_get_file(client, path);