mirror of
https://github.com/3lswear/webserv.git
synced 2025-10-29 13:27:59 +03:00
add: url decode, and change client_body_size var to ssize_t
This commit is contained in:
@@ -33,7 +33,7 @@ int &ServerConfig::getPort(void)
|
||||
return (_port);
|
||||
}
|
||||
|
||||
int &ServerConfig::getClientBodySize(void)
|
||||
ssize_t &ServerConfig::getClientBodySize(void)
|
||||
{
|
||||
return (_clientBodySize);
|
||||
}
|
||||
@@ -206,7 +206,7 @@ int ServerConfig::putLocation(toml_node *node)
|
||||
else if (it1->first == "body_size_limit")
|
||||
{
|
||||
DBOUT << "BodySize in locaton" << ENDL;
|
||||
if (node->get_type() != toml_node::NUM)
|
||||
if (it1->second->get_type() != toml_node::NUM)
|
||||
continue;
|
||||
tmp->clientBodySize = it1->second->getNum();
|
||||
}
|
||||
@@ -241,7 +241,7 @@ int ServerConfig::putLocation(toml_node *node)
|
||||
tmp->redirect.insert(std::make_pair(atoi(str.c_str()), *(*it2)->getString()));
|
||||
}
|
||||
else
|
||||
std::cout << RED << it1->first << ZERO_C << std::endl;
|
||||
std::cerr << RED << "Warning: unknown parameter: "<< it1->first << ZERO_C << std::endl;
|
||||
}
|
||||
_locations.push_back(tmp);
|
||||
it++;
|
||||
|
||||
@@ -15,7 +15,7 @@ struct location
|
||||
std::vector<std::string> methods;
|
||||
std::map<int, std::string> redirect;
|
||||
std::string cgi_pass;
|
||||
unsigned int clientBodySize;
|
||||
ssize_t clientBodySize;
|
||||
};
|
||||
|
||||
struct serverListen
|
||||
@@ -33,7 +33,7 @@ private:
|
||||
std::string _serverName;
|
||||
std::string _host;
|
||||
int _port;
|
||||
int _clientBodySize;
|
||||
ssize_t _clientBodySize;
|
||||
|
||||
std::map<int, std::string> _errorPages;
|
||||
std::vector<location *> _locations;
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
std::string &getServerName(void);
|
||||
std::string &getHost(void);
|
||||
int &getPort(void);
|
||||
int &getClientBodySize(void);
|
||||
ssize_t &getClientBodySize(void);
|
||||
std::vector<location *> &getLocations(void);
|
||||
std::map<int, std::string> &getErrorPages(void);
|
||||
TOMLMap *getRoot(void);
|
||||
|
||||
Reference in New Issue
Block a user