mirror of
https://github.com/3lswear/webserv.git
synced 2025-10-28 21:07:59 +03:00
fix: misc
This commit is contained in:
@@ -115,7 +115,9 @@ std::string CgiHandle::executeCgi()
|
|||||||
dup2(fdin, STDIN_FILENO);
|
dup2(fdin, STDIN_FILENO);
|
||||||
dup2(fdOut, STDOUT_FILENO);
|
dup2(fdOut, STDOUT_FILENO);
|
||||||
execve(_response.getCgiPass().c_str(), argv, env);
|
execve(_response.getCgiPass().c_str(), argv, env);
|
||||||
std::cerr << WARNING << getDebugTime() << FAIL << " Execve error." << ENDL;
|
std::cerr << getDebugTime() << FAIL;
|
||||||
|
perror(" Execve error");
|
||||||
|
std::cerr << RESET;
|
||||||
write(STDOUT_FILENO, "Status: 500\r\n\r\n", 15);
|
write(STDOUT_FILENO, "Status: 500\r\n\r\n", 15);
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,14 +22,17 @@ std::string getDebugTime(void)
|
|||||||
{
|
{
|
||||||
time_t rawtime;
|
time_t rawtime;
|
||||||
struct tm *timeinfo;
|
struct tm *timeinfo;
|
||||||
char buf[32];
|
|
||||||
|
|
||||||
time(&rawtime);
|
time(&rawtime);
|
||||||
timeinfo = localtime(&rawtime);
|
timeinfo = localtime(&rawtime);
|
||||||
|
|
||||||
int tmp = strftime(buf, 32, "%T", timeinfo);
|
std::string ret = std::string(asctime(timeinfo));
|
||||||
buf[tmp] = '\0';
|
for (size_t i = 0; i < 3; i++)
|
||||||
std::string ret = std::string(buf);
|
{
|
||||||
|
ret.erase(0, ret.find(" ") + 1);
|
||||||
|
}
|
||||||
|
ret.erase(ret.find(" "));
|
||||||
|
|
||||||
ret = std::string(WARNING) + "[ " + ret + " ] "
|
ret = std::string(WARNING) + "[ " + ret + " ] "
|
||||||
+ std::string(RESET)
|
+ std::string(RESET)
|
||||||
+ std::string(OKCYAN);
|
+ std::string(OKCYAN);
|
||||||
|
|||||||
Reference in New Issue
Block a user