Fixed routing in the brynet backend.

This commit is contained in:
Relintai 2021-07-06 20:23:13 +02:00
parent a16222e29e
commit 92ce00a88c
4 changed files with 10 additions and 28 deletions

View File

@ -60,28 +60,21 @@ void BryRequest::send_file(const std::string &p_file_path) {
}
void BryRequest::reset() {
application = nullptr;
Request::reset();
http_parser = nullptr;
session = nullptr;
current_middleware_index = 0;
middleware_stack = nullptr;
_path_stack.clear();
_path_stack_pointer = 0;
file_size = 0;
current_file_progress = 0;
connection_closed = false;
head.clear();
body.clear();
footer.clear();
compiled_body.clear();
if (response)
delete response;
response = new ::HttpResponse();
}
std::string BryRequest::parser_get_path() {
return http_parser->getPath();
}
void BryRequest::update() {
if (file_next) {
file_next = false;

View File

@ -22,6 +22,7 @@ public:
void send();
void send_file(const std::string &p_file_path);
void reset();
std::string parser_get_path();
void update();

View File

@ -67,6 +67,7 @@ void Request::reset() {
file_size = 0;
current_file_progress = 0;
connection_closed = false;
_full_path = "";
head.clear();
body.clear();
@ -76,7 +77,6 @@ void Request::reset() {
std::string Request::parser_get_path() {
return "";
//return http_parser->getPath();
}
void Request::setup_url_stack() {

View File

@ -46,19 +46,7 @@ void DRequest::send_file(const std::string &p_file_path) {
}
void DRequest::reset() {
application = nullptr;
current_middleware_index = 0;
middleware_stack = nullptr;
_path_stack.clear();
_path_stack_pointer = 0;
file_size = 0;
current_file_progress = 0;
connection_closed = false;
head.clear();
body.clear();
footer.clear();
compiled_body.clear();
Request::reset();
response.reset();
request.reset();