diff --git a/core/bry_http/bry_request.cpp b/core/bry_http/bry_request.cpp index 42665cf..2b84c19 100644 --- a/core/bry_http/bry_request.cpp +++ b/core/bry_http/bry_request.cpp @@ -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; diff --git a/core/bry_http/bry_request.h b/core/bry_http/bry_request.h index f819ab0..5ddb896 100644 --- a/core/bry_http/bry_request.h +++ b/core/bry_http/bry_request.h @@ -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(); diff --git a/core/http/request.cpp b/core/http/request.cpp index 54a7d0a..5aff92b 100644 --- a/core/http/request.cpp +++ b/core/http/request.cpp @@ -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() { diff --git a/modules/drogon/request.cpp b/modules/drogon/request.cpp index adbb1bb..1ff2931 100644 --- a/modules/drogon/request.cpp +++ b/modules/drogon/request.cpp @@ -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();