mirror of
https://github.com/Relintai/rcpp_framework.git
synced 2024-11-14 04:57:21 +01:00
40 lines
691 B
C++
40 lines
691 B
C++
#ifndef REQUEST_H
|
|
#define REQUEST_H
|
|
|
|
#include <vector>
|
|
#include <mutex>
|
|
|
|
#include <brynet/net/http/HttpService.hpp>
|
|
#include <brynet/net/http/HttpFormat.hpp>
|
|
|
|
using namespace brynet;
|
|
using namespace brynet::net;
|
|
using namespace brynet::net::http;
|
|
|
|
class Request {
|
|
public:
|
|
const HTTPParser *http_parser;
|
|
const HttpSession::Ptr *session;
|
|
HttpResponse *response;
|
|
bool finalized;
|
|
|
|
void reset();
|
|
|
|
Request();
|
|
~Request();
|
|
};
|
|
|
|
class RequestPool {
|
|
public:
|
|
static Request *get_request();
|
|
static void return_request(Request *request);
|
|
|
|
RequestPool();
|
|
~RequestPool();
|
|
|
|
protected:
|
|
static std::mutex _mutex;
|
|
static std::vector<Request *> _requests;
|
|
};
|
|
|
|
#endif |