mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-10 00:52:11 +01:00
Removed the middleware stack from Request.
This commit is contained in:
parent
ec2eabacc1
commit
15b9bb17e5
@ -79,21 +79,6 @@ void Request::compile_and_send_body() {
|
||||
send();
|
||||
}
|
||||
|
||||
void Request::next_stage() {
|
||||
// if (middleware_stack == nullptr) {
|
||||
// printf("Error Request::next_stage-> middleware_stack == nullptr\n");
|
||||
// }
|
||||
|
||||
if (current_middleware_index == (*middleware_stack).size()) {
|
||||
handler_instance.handler_func(handler_instance.instance, this);
|
||||
return;
|
||||
}
|
||||
|
||||
const HandlerInstance &hi = (*middleware_stack)[current_middleware_index++];
|
||||
|
||||
hi.handler_func(hi.instance, this);
|
||||
}
|
||||
|
||||
void Request::send() {
|
||||
// if (connection_closed) {
|
||||
// RequestPool::return_request(this);
|
||||
@ -114,8 +99,6 @@ void Request::send_error(int error_code) {
|
||||
void Request::reset() {
|
||||
session = nullptr;
|
||||
server = nullptr;
|
||||
current_middleware_index = 0;
|
||||
middleware_stack = nullptr;
|
||||
_path_stack.clear();
|
||||
_path_stack_pointer = 0;
|
||||
file_size = 0;
|
||||
|
@ -23,10 +23,6 @@ class Request {
|
||||
public:
|
||||
WebServer *server;
|
||||
|
||||
uint32_t current_middleware_index;
|
||||
HandlerInstance handler_instance;
|
||||
std::vector<HandlerInstance> *middleware_stack;
|
||||
|
||||
String head;
|
||||
String body;
|
||||
String footer;
|
||||
@ -60,7 +56,6 @@ public:
|
||||
virtual void send_redirect(const String &location, const HTTPStatusCode status_code = HTTP_STATUS_CODE_302_FOUND);
|
||||
virtual void compile_body();
|
||||
virtual void compile_and_send_body();
|
||||
virtual void next_stage();
|
||||
virtual void send();
|
||||
virtual void send_file(const String &p_file_path);
|
||||
virtual void send_error(int error_code);
|
||||
|
Loading…
Reference in New Issue
Block a user