diff --git a/modules/web/http/web_server_request.h b/modules/web/http/web_server_request.h index 5fe0c1282..0b9c66fbd 100644 --- a/modules/web/http/web_server_request.h +++ b/modules/web/http/web_server_request.h @@ -114,62 +114,4 @@ protected: uint32_t _path_stack_pointer; }; -template -class WebServerRequestPool { -public: - T *get_request(); - void return_request(T *request); - - WebServerRequestPool(); - ~WebServerRequestPool(); - -protected: - std::mutex _mutex; - std::vector _requests; -}; - -template -T *WebServerRequestPool::get_request() { - _mutex.lock(); - - T *request; - - if (_requests.size() == 0) { - _mutex.unlock(); - - request = new T(); - - return request; - } - - request = _requests[_requests.size() - 1]; - _requests.pop_back(); - - _mutex.unlock(); - - request->reset(); - - return request; -} - -template -void WebServerRequestPool::return_request(T *request) { - _mutex.lock(); - _requests.push_back(request); - _mutex.unlock(); -} - -template -WebServerRequestPool::WebServerRequestPool() { -} - -template -WebServerRequestPool::~WebServerRequestPool() { - for (uint32_t i = 0; i < _requests.size(); ++i) { - delete _requests[i]; - } - - _requests.clear(); -} - #endif