mirror of
https://github.com/3lswear/webserv.git
synced 2025-10-28 21:07:59 +03:00
upstream changes (src)
This commit is contained in:
@@ -92,7 +92,7 @@ std::string CgiHandle::executeCgi()
|
||||
}
|
||||
catch(const std::bad_alloc& e)
|
||||
{
|
||||
std::cerr << WARNING << getDebugTime() << FAIL << " " << e.what() << ENDL;
|
||||
std::cerr << WARNING << getDebugTime() << FAIL << e.what() << ENDL;
|
||||
}
|
||||
sI = dup(STDIN_FILENO);
|
||||
sO = dup(STDOUT_FILENO);
|
||||
|
||||
@@ -185,7 +185,7 @@ std::string Client::generateRespons(std::vector<ServerConfig *> &configs)
|
||||
std::memcpy(_to_send_char, _toSend->c_str(), len + 1);
|
||||
|
||||
//print request
|
||||
std::cerr << WARNING << getDebugTime() << GREEN;
|
||||
std::cerr << WARNING << getDebugTime() << TURGUOISE;
|
||||
if (_request.getCode() != 200)
|
||||
std::cerr << FAIL ;
|
||||
std::cerr << "[ request ] : "
|
||||
|
||||
@@ -239,7 +239,7 @@ std::string Response::getContentType(void)
|
||||
else if (type == "pdf")
|
||||
return ("application/pdf");
|
||||
else
|
||||
return ("application/octet-stream");
|
||||
return ("text/plain");
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -22,17 +22,14 @@ std::string getDebugTime(void)
|
||||
{
|
||||
time_t rawtime;
|
||||
struct tm *timeinfo;
|
||||
char buf[32];
|
||||
|
||||
time(&rawtime);
|
||||
timeinfo = localtime(&rawtime);
|
||||
|
||||
std::string ret = std::string(asctime(timeinfo));
|
||||
for (size_t i = 0; i < 3; i++)
|
||||
{
|
||||
ret.erase(0, ret.find(" ") + 1);
|
||||
}
|
||||
ret.erase(ret.find(" "));
|
||||
|
||||
int tmp = strftime(buf, 32, "%T", timeinfo);
|
||||
buf[tmp] = '\0';
|
||||
std::string ret = std::string(buf);
|
||||
ret = std::string(WARNING) + "[ " + ret + " ] "
|
||||
+ std::string(RESET)
|
||||
+ std::string(OKCYAN);
|
||||
|
||||
@@ -24,7 +24,7 @@ int main(int argc, char **argv)
|
||||
catch(const ConfigException& e)
|
||||
{
|
||||
std::cerr << RED << "\n" << WARNING << getDebugTime()
|
||||
<< FAIL << " " << e.getMessage() << ENDL;
|
||||
<< FAIL << e.getMessage() << ENDL;
|
||||
}
|
||||
catch (std::domain_error &e)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user