mirror of
https://github.com/KeyZox71/webserv.git
synced 2025-07-16 12:36:32 +02:00
「🔨」 fix: fixed cgiin issue
This commit is contained in:
@ -6,7 +6,7 @@
|
|||||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/05/13 18:14:45 by adjoly #+# #+# */
|
/* Created: 2025/05/13 18:14:45 by adjoly #+# #+# */
|
||||||
/* Updated: 2025/07/01 11:17:52 by adjoly ### ########.fr */
|
/* Updated: 2025/07/02 11:35:04 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -16,6 +16,7 @@
|
|||||||
#include <log.hpp>
|
#include <log.hpp>
|
||||||
#include <server/PfdManager.hpp>
|
#include <server/PfdManager.hpp>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
#include <sys/poll.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
namespace webserv {
|
namespace webserv {
|
||||||
@ -51,6 +52,10 @@ class CgiIn : public AClientResource {
|
|||||||
clientResType type(void) const { return CGI_IN; }
|
clientResType type(void) const { return CGI_IN; }
|
||||||
short event(void) const { return POLLIN; }
|
short event(void) const { return POLLIN; }
|
||||||
bool isReady(void) const {
|
bool isReady(void) const {
|
||||||
|
if (PfdManager::get(_fd)->revents & event()) {
|
||||||
|
_log->debug("CgiIn not ready");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
_log->debug("CgiIn ready");
|
_log->debug("CgiIn ready");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -6,11 +6,12 @@
|
|||||||
/* By: gadelbes <gadelbes@student.42.fr> +#+ +:+ +#+ */
|
/* By: gadelbes <gadelbes@student.42.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2025/04/24 13:46:34 by gadelbes #+# #+# */
|
/* Created: 2025/04/24 13:46:34 by gadelbes #+# #+# */
|
||||||
/* Updated: 2025/07/01 11:26:11 by adjoly ### ########.fr */
|
/* Updated: 2025/07/02 11:37:44 by adjoly ### ########.fr */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
#include "server/PfdManager.hpp"
|
#include "server/PfdManager.hpp"
|
||||||
|
#include "server/ResourceManager.hpp"
|
||||||
#include <help.hpp>
|
#include <help.hpp>
|
||||||
#include <ios>
|
#include <ios>
|
||||||
#include <requests/default.hpp>
|
#include <requests/default.hpp>
|
||||||
@ -56,7 +57,13 @@ Cgi::Cgi(http::Post *req, config::Route *conf)
|
|||||||
server::PfdManager::append(pfd, server::RES);
|
server::PfdManager::append(pfd, server::RES);
|
||||||
}
|
}
|
||||||
|
|
||||||
Cgi::~Cgi(void) { log("➖", "Cgi", "destructor called"); }
|
Cgi::~Cgi(void) {
|
||||||
|
log("➖", "Cgi", "destructor called");
|
||||||
|
if (_is_post) {
|
||||||
|
PfdManager::remove(_stdin_pipe[PIPE_WRITE]);
|
||||||
|
ResourceManager::remove(_stdin_pipe[PIPE_WRITE]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void Cgi::_prep(void) {
|
void Cgi::_prep(void) {
|
||||||
if (_is_post)
|
if (_is_post)
|
||||||
|
Reference in New Issue
Block a user