CGI discussion and a little bit of work done
This commit is contained in:
@@ -1,14 +1,21 @@
|
||||
|
||||
#include "Webserv.hpp"
|
||||
|
||||
bool Webserv::_is_cgi(Client *client)
|
||||
// TODO HUGO : go ameliorer la recherche comme on a dit.
|
||||
size_t Webserv::_cgi_pos(Client *client, std::string &path)
|
||||
{
|
||||
// TODO see how it works with config
|
||||
if (client->fill_script_path("/cgi-bin/php-cgi"))
|
||||
size_t pos = NPOS;
|
||||
std::vector<std::string>::const_iterator it;
|
||||
it = client->assigned_location->cgi_ext.begin();
|
||||
while (it != client->assigned_location->cgi_ext.end())
|
||||
{
|
||||
pos = std::min(path.find(*it) + it->size(), pos);
|
||||
++it;
|
||||
}
|
||||
if (pos == NPOS)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
if (client->fill_script_path("/cgi-bin/cgi_cpp.cgi"))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string Webserv::_exec_cgi(Client *client)
|
||||
|
||||
Reference in New Issue
Block a user